Add hook for customizing exceptions

The exceptions can be customized via a new ErrorHandler class, which is
responsible for throwing customized exceptions during synchronous
requests, or calling an appropriate callback method for asynchronous
requests.
Merge pull request #1 from sberan/exceptionHandler

Error Handling