Add error handlers (on_error and on_default_error).
Merge pull request #50 from alanhdu/master

Add optional exception handler