Some error handling

My ruby is bad, so I'm cowardly not committing straight to master.
Can we limit which exceptions to trap here, even if it's to StandardError (or a subclass thereof)? 

Regardless, it's probably wise to include the exception details when reporting the error, so we at least have a clue what to fix :)