As it is currently, any errors that are thrown in any middleware after the body parser are caught and passed through the onError config option. This pull request fixes the order so that only body parsing errors are passed to the onError function, not all errors from other middleware.
As it is currently, any errors that are thrown in any middleware after the body parser are caught and passed through the
onError
config option. This pull request fixes the order so that only body parsing errors are passed to theonError
function, not all errors from other middleware.