I have been doing something very similar. I have thought about taking it to
the next level and making it so that errorHandler actually sends the message
(url,lno,msg) to me (the developer) via e-mail in the background, but
returns true to the application so that the user is unaware that an error
occurred. This way once the application is deployed I can keep a pulse on
errors in the real world and take care of errors missed in the testing, yet
the user is not hindered since all of this notification happens in the
background.
Any thoughts on implementation?
Jim
----- Original Message -----
From: "Michael Pemberton" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 14, 2001 11:21 PM
Subject: Re: [Dynapi-Dev] A handy DEBUG method
> I've got an alternative method that caches the errors until everything has
> loaded and generates a error output page. It can also be told to display
> javascript errors or even catch and not display javascript errors.
>
> DynAPI {
> errors : [],
> displayerrors : false, // indicates if you wish all errors to be
caught or
> sent to the in-built js console
> errorHandler : function (msg, url, lno) {
> DynAPI.errors[DynAPI.errors.length] = [url,lno,msg];
> // if the page has already loaded, errors will be alerted instead
of
> sent to the debug page
> if (DynAPI.loaded&&DynAPI.displayerrors)
> alert("Error in '" + url + "'.\nLine number: " + lno +
> ".\nMessage: " + msg);
> return DynAPI.displayerrors;
> },
>
> // The following line is added at the end of the loadHandler:
> if (DynAPI.errors.length&&DynAPI.displayerrors) DynAPI.errorOutput();
>
> // The following line is added at the end of the dynapi.js
> onerror = DynAPI.errorHandler;
>
> --
> Michael Pemberton
> [EMAIL PROTECTED]
> ICQ: 12107010
>
>
>
>
>
>
> _______________________________________________
> Dynapi-Dev mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/dynapi-dev
>
_______________________________________________
Dynapi-Dev mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-dev