Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught error when using next function with error in middlleware #432

Closed
shyimo opened this issue Feb 18, 2018 · 3 comments
Closed

Uncaught error when using next function with error in middlleware #432

shyimo opened this issue Feb 18, 2018 · 3 comments

Comments

@shyimo
Copy link

shyimo commented Feb 18, 2018

I'm submitting a...

[ ] Regression

Current behavior

When calling next with error in express middleware the error handler does not catch it.

Example:

  • some-file.js:
    class CustomError extends Error {
    constructor(errors, place, message) {
    super(message);
    this.errors = errors;
    }
    }
    function someMiddlleware(req, res, next) {
    return next(new CustomError(new Error('Some_error')));
    }

  • error-handler.js
    @catch(CustomError)
    exports class CustomErrorFilter implements ExceptionFilter {
    catch(exception, response) {
    /// do some logic...
    }
    }

Expected behavior

CustomErrorFilter should catch the error.

  • It seems that the problem only occurs in the version 4.6.xx
@bojidaryovchev
Copy link

#431 is that the same problem?

@kamilmysliwiec
Copy link
Member

duplicate of #431

@lock
Copy link

lock bot commented Sep 25, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants