Added additional parameter to provide more information to error event callbacks.