Not sure how (possibly accidental undo), but I messed up my previous
commit - would get a "handleError is not defined" error when an error
occurred.
Merge pull request #2 from ind1go/error-handler2

My previous error handling commit was bad - this should be better!