-
-
Notifications
You must be signed in to change notification settings - Fork 175
custom error handler cannot call next() #181
Copy link
Copy link
Open
Description
as stated in the onError documentation:
Caution: Use next() to bypass certain errors at your own risk!
You must be certain that the exception will be handled elsewhere or can be safely ignored.
Otherwise your response will never terminate!
It should be cool to set 'next' to the default onError in the call of the custom procedure.
ie instead of (in the polka ctor):
this.onError = opts.onError || onError; // catch-all handlersomethink like:
this.onError = onError;
if( opts.onError ) {
this.onError = function( err, req, res, next ) {
opts.onError( err, req, res, onError );
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels