Capturing and reporting errors from Amber

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Capturing and reporting errors from Amber

R. Tyler Croy
I'm working on a new Amber project, and when in deployment mode I'd like to
capture all global errors and use a jQuery.ajax POST to send them along to the
server to be logged/dealt with.

In normal JavaScript land I'd tack a window.onerror handler and then hope and
pray that it was called properly, but surely there's somnething better I can do
to capture errors in the Smalltalk runtime, isn't there?

- R. Tyler Croy
--------------------------------------
    Code: https://github.com/rtyler
 Chatter: https://twitter.com/agentdero

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Capturing and reporting errors from Amber

Nicolas Petton

If you are catching errors from Amber, then you can create a custom
ErrorHandler subclass, and override #handleError:

To register your error handler, you can do:

MyErrorHandler register

HTH,
Nico

"R. Tyler Croy" <[hidden email]> writes:

> I'm working on a new Amber project, and when in deployment mode I'd like to
> capture all global errors and use a jQuery.ajax POST to send them along to the
> server to be logged/dealt with.
>
> In normal JavaScript land I'd tack a window.onerror handler and then hope and
> pray that it was called properly, but surely there's somnething better I can do
> to capture errors in the Smalltalk runtime, isn't there?
>
> - R. Tyler Croy
> --------------------------------------
>     Code: https://github.com/rtyler
>  Chatter: https://twitter.com/agentdero

--
Nicolas Petton
http://nicolas-petton.fr