Apache – Error reporting from Flex app

apache-flexflex3

I have a Flex 3 app which I want to instrument to report errors generated by the app to a server via simple HTTPService call.

My idea is to wrap all the methods in try … catch blocks which then pass the Error object to the reportError() function (which then fires off the HTTP request and pops up a dialog) but is there a better way?

Best Answer

I have implemented a system such as the one you suggest, wrapping all of my methods in try/catch and sending the stack trace to a service that emails me the errors. I created a basic format for the error that logs which method the error occurred in. I noticed that sometimes I end up getting null from the stack traces, so I wanted to log that information for these situations.

It GREATLY improved my application. I tracked down a (large) handful of errors and released a much cleaner build to my users. Now I don't ever get the emails.