Support for custom callbacks when SQL error occurs. Resolves #7