NokSync

KaarPoSoft

lib.js_ File Reference


Detailed Description

Library with logging, error handling, and initialization.

When including this script, define var where="xxx". The text will be part of log and error messages.

Include this script, and execute init(). This will initialize the global variables

Functions for logging and error handling:


Functions

void  error (string s, error e)
void  error2 (string t, string s, error e)
void  errorClose (string s, error e, Object er)
void  errorClose2 (string s, error e)
void  errorCloseNmp (string s, error e, Object nmp)
void  errorDisplayThrowNmp (string s, error e, Object nmp)
void  errorNmp (string s, error e, Object nmp)
void  init ()
void  log (int n, string s)
void  openURL (string url)

Variables

nsIConsoleService  consoleService
boolean  initialized
string  logLevel
string  NS
nsIPromptService  promptService

Function Documentation

void error ( string  s,
error  e  
)

Display error message as window, and log to JavaScript console

Parameters:
s  A string explaining where the error occured
e  The error to report

void error2 ( string  t,
string  s,
error  e  
)

Display error message with additional text as window, and log to JavaScript console

Parameters:
t  A string explaining where the error occured
s  A string explaining how the error occured
e  The error to report

void errorClose ( string  s,
error  e,
Object  er  
)

Display error message with additional text as window, and log to JavaScript console. Set er.error to true (for returning the error message to "calling" window). Close originating window.

Parameters:
s  A string explaining how the error occured
e  The error to report
er  The error object in which .error shall be set

void errorClose2 ( string  s,
error  e  
)

Display error message with additional text as window, and log to JavaScript console. Close originating window.

Parameters:
s  A string explaining how the error occured
e  The error to report

void errorCloseNmp ( string  s,
error  e,
Object  nmp  
)

Display NMP (NOKIA) error message with additional text as window, and log to JavaScript console. Close originating window.

Parameters:
s  A string explaining how the error occured
e  The error to report
nmp  The NMP (NOKIA) object from which the originated

void errorDisplayThrowNmp ( string  s,
error  e,
Object  nmp  
)

Display NMP (NOKIA) error message with additional text as window, and log to JavaScript console. Rethrow base exception.

Parameters:
s  A string explaining how the error occured
e  The error to report
nmp  The NMP (NOKIA) object from which the originated

void errorNmp ( string  s,
error  e,
Object  nmp  
)

Display NMP (NOKIA) error message with additional text as window, and log to JavaScript console.

Parameters:
s  A string explaining how the error occured
e  The error to report
nmp  The NMP (NOKIA) object from which the originated

void init (  ) 

Initialize

void log ( int  n,
string  s  
)

Log message to JavaScript console

Parameters:
n  Log level. 1: Global; 2: Each contact; 3: More detail
s  The string to write to the console

void openURL ( string  url  ) 

Open specified URL in browser. window.open() does not work with URL's from Thunderbird

Parameters:
url 


Variable Documentation

nsIConsoleService consoleService

For logging to the JavaScript console

boolean initialized

Remember if already initialized

string logLevel

Global. Level for logging. 1: Global; 2: Each contact; 3: More detail

string NS

Global namespace for NokaSync

nsIPromptService promptService

For window dialog message

Doxygen.org   SourceForge.net