Error handler

Added custom error handler to improve the chances of this project making everything work perfectly!
Merge pull request #2 from Lusitanian/patch-1

Error handler