Skip to content

Falcon integration does not respect custom exception handlers #1362

@alexmic

Description

@alexmic

How do you use Sentry?

Sentry Saas (sentry.io)

Version

1.5.6

Steps to Reproduce

  1. Attach a custom exception handler:
import marshmallow

def marshmallow_validation_error_handler(req, res, exc, params):
    """Transforms a marshmallow validation error into the appropriate HTTP response."""
    raise falcon.HTTPError(400)

api.add_error_handler(marshmallow.ValidationError, marshmallow_validation_error_handler)
  1. Do an API request that leads to a validation error

Expected Result

The marshmallow exception should not have been reported to Sentry.

Actual Result

The custom exception leads to a 4xx, not a 5xx, yet it is still reported as an unhandled error on Sentry.

Metadata

Metadata

No fields configured for issues without a type.

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions