You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having difficulties with using custom error handlers. Maybe I didn't understand the documentation right. Please take a look at the code snippets below.
This is my setup:
app.message("error",async()=>{thrownewError("Error 1");});app.message("with next",({ next })=>{next(newError("Error"));});app.error(error=>{console.log("Inside error handler:");console.log("Custom error handler",error);});
None of these messages passes the execution flow to the error handler. What I'm doing wrong?
I suspect that customizing this.on('error', ...) in ExpressReceiver may help to get desirable results (customizable error handler), but why do we need app.error(...) then?
What type of issue is this? (place an x in one of the [ ])
bug
enhancement (feature request)
question
documentation related
testing related
discussion
Requirements (place an x in each of the [ ])
I've read and understood the Contributing guidelines and have done my best effort to follow them.
I've searched for any related issues and avoided creating a duplicate issue.
Bug Report
Filling out the following details about bugs will help us solve your issue sooner.
Reproducible in:
package version: 1.2.0
node version: 12.6.0
OS version(s): macOS Mojave 10.14.5
Steps to reproduce:
Launch Bolt boilerplate.
Copy the code from the description section of this message.
Trigger both messages.
See that console.logs, placed in the custom error handler are not called.
Expected result:
I'm expecting app.error to catch all unhandled errors and errors from next() function. (I could be wrong about some details regarding error handling in Bolt).
Actual result:
It's impossible to get into the handler which you passed into app.error(...).
Attachments:
The text was updated successfully, but these errors were encountered:
Description
I'm having difficulties with using custom error handlers. Maybe I didn't understand the documentation right. Please take a look at the code snippets below.
This is my setup:
None of these messages passes the execution flow to the error handler. What I'm doing wrong?
I suspect that customizing
this.on('error', ...)
in ExpressReceiver may help to get desirable results (customizable error handler), but why do we needapp.error(...)
then?What type of issue is this? (place an
x
in one of the[ ]
)Requirements (place an
x
in each of the[ ]
)Bug Report
Filling out the following details about bugs will help us solve your issue sooner.
Reproducible in:
package version: 1.2.0
node version: 12.6.0
OS version(s): macOS Mojave 10.14.5
Steps to reproduce:
Expected result:
I'm expecting
app.error
to catch all unhandled errors and errors fromnext()
function. (I could be wrong about some details regarding error handling in Bolt).Actual result:
It's impossible to get into the handler which you passed into
app.error(...)
.Attachments:
The text was updated successfully, but these errors were encountered: