Added support for accessing the error object. Issue #29 Thanks @alexandremblah