Add basic error handling.
Remove duplicate error handler.
Merge pull request #2 from colinbate/master

Add basic error handling