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

Errors seem to be handled incorrectly #6

Open
gboston opened this issue Apr 7, 2020 · 0 comments · May be fixed by #7
Open

Errors seem to be handled incorrectly #6

gboston opened this issue Apr 7, 2020 · 0 comments · May be fixed by #7

Comments

@gboston
Copy link

gboston commented Apr 7, 2020

Is it possible to just return the errors to the client instead of returning a 500 by default?
I've done an overwrite of the error handler and this gives me the expected behavior:

fastify.register(require('fastify-sentry'), {
      dsn: '',
      errorHandler: (err, _, reply) => {
        if (err) {
          reply.send(err);
        }
      },
    });

This allows me to have decent validation errors without any additional efforts. Maybe best to implement a different default error handler?

gboston added a commit to gboston/fastify-sentry that referenced this issue Apr 7, 2020
Allow fastify to pick up the error.
Resolves: alex-ppg#6
@gboston gboston linked a pull request Apr 7, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant