Introduced error handling hook
Closes #3: error handling is now documented