snake_eyes
06-04-2007, 07:52 AM
Hello,
I have the following code:
var ErrorsHandler = {
handleError: function(errorMsg, errorUrl, errorLine)
{
if( Config.ErrorsHandlerOnce &&
ErrorsHandler.lastErrorUrl == errorUrl &&
ErrorsHandler.lastErrorMsg == errorMsg &&
ErrorsHandler.lastErrorLine == errorLine ){
return true;
}
if(Config.ErrorsHandlerLog){
(new Image).src = Config.ErrorsHandlerURL +
"?errorUrl=" + escape(errorUrl) +
"&errorLine=" + escape(errorLine) +
"&errorMsg=" + escape(errorMsg);
}
if(Config.ErrorsHandlerDebug){
alert('----------------------------------\n\n' +
' Error URL : ' + errorUrl + '\n\n' +
' Error Line : ' + errorLine + '\n\n' +
' Error Message: ' + errorMsg + '\n\n' +
'----------------------------------') ;
}
ErrorsHandler.lastErrorUrl = errorUrl;
ErrorsHandler.lastErrorMsg = errorMsg;
ErrorsHandler.lastErrorLine = errorLine;
return true;
}
};
window.onerror = ErrorsHandler.handleError;
how do I merge the above code in the ajax request in order to utilize it to handle all the errors
Regards heaps,
I have the following code:
var ErrorsHandler = {
handleError: function(errorMsg, errorUrl, errorLine)
{
if( Config.ErrorsHandlerOnce &&
ErrorsHandler.lastErrorUrl == errorUrl &&
ErrorsHandler.lastErrorMsg == errorMsg &&
ErrorsHandler.lastErrorLine == errorLine ){
return true;
}
if(Config.ErrorsHandlerLog){
(new Image).src = Config.ErrorsHandlerURL +
"?errorUrl=" + escape(errorUrl) +
"&errorLine=" + escape(errorLine) +
"&errorMsg=" + escape(errorMsg);
}
if(Config.ErrorsHandlerDebug){
alert('----------------------------------\n\n' +
' Error URL : ' + errorUrl + '\n\n' +
' Error Line : ' + errorLine + '\n\n' +
' Error Message: ' + errorMsg + '\n\n' +
'----------------------------------') ;
}
ErrorsHandler.lastErrorUrl = errorUrl;
ErrorsHandler.lastErrorMsg = errorMsg;
ErrorsHandler.lastErrorLine = errorLine;
return true;
}
};
window.onerror = ErrorsHandler.handleError;
how do I merge the above code in the ajax request in order to utilize it to handle all the errors
Regards heaps,