Emit error event when error is passed to callback.