Completed the error handling mechanism (#2)
Merge branch 'error-handling'