Handling iPhone errors with ErrorStack


Back in February, I attended the CTO Breakfast hosted by Phil Windley, and I was able to learn about a hosted error management system called ErrorStack. I did not get much time to play with it at the time, but I’ve had some free time lately so I’ve been able to put it to use.

ErrorStack is hosted on the Google App Engine, and they give access to your errors through their website and their flex application. I like the layout of the errors on the website a little more than the flex app, but I usually have the flex app open to tell me when I receive errors. They also send out nightly email as a digist of errors received in the last 24 hours. I do like the idea of digest style. I have a filter in my email to filter out all my error emails. Because it gets so big, and its not in my face, I always forget to look in the folder at the emails. These nightly emails are a lot easier to handle and don’t spam my inbox.

As we release updates for our iPhone we do a lot of testing through beta testers. Ive been able to use ErrorStack in my app to help me get the real exceptions and errors that are happening. This is really helpful when I’m not able to see a crash log, or the testers don’t know exactly what they did.

I made a little class to send the errors to the ErrorStack sytem. You just make a call to ErrorStack with your error name and reason. Name and Reason are what NSExceptions use so I use those as parameters. I’ve also added the log to contain the version of the iPhone platform and the version of your software. This is great if you have different versions out with beta testers.

You can download my iPhone ErrorStack Code here.

This can handle exceptions and your own messages. Ive really only used it with my own messages because I don’t have many exceptions thrown. If you wanted to you could do something like this though.

Catching an Exception

If you saw that I would hope you knew what the problem is, but whatever. This will send the error to ErrorStack sytem which will appear in your stack. I’ve named my variables a little different than ErrorStacks, but they let you call them whatever you want.

The error on ErrorStack

When its on ErrorStack, anyone who you let view your stack can view this error, and when you have fixed or recognized the erorr you can clear it off of ErorrStack. This makes it a lot handier than email where you may have 3 people working on the same bug.

I am very impressed with ErrorStack and plan to use it in my future projects. They have pre-written code for Python and Javascript at this time, and I believe they are planning to add more. I recommend checking it out, and using it in your future projects. I would love if someone would write an extension for log4j. Also, If you want an invite I think I have 1 left.

Comments are closed.