Best practices for catching errors?

A bit late to the party, but I ended up doing this to get error monitoring working.