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 () => {
throw new Error("Error 1");
});
app.message("with next", ({ next }) => {
next(new Error("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?
x in one of the [ ])x in each of the [ ])Filling out the following details about bugs will help us solve your issue sooner.
package version: 1.2.0
node version: 12.6.0
OS version(s): macOS Mojave 10.14.5
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).
It's impossible to get into the handler which you passed into app.error(...).

@stevengill @aoberoi My understanding is that this issue has been resolved by v2 release. Can we close this issue now?
@seratch I believe you are right. @aoberoi do you agree?
I agree! I just created a label for v1 and applied it to this issue so it鈥檚 easier to see that it was a bug but only applies to that version series.
Most helpful comment
@stevengill @aoberoi My understanding is that this issue has been resolved by v2 release. Can we close this issue now?