Skip to content

Exceptions with http status code 400 ignore exception settings #1204

@tamoyal

Description

@tamoyal

Regardless of my exception settings in Sinatra (the flags raise_errors, dump_errors, show_exceptions), exceptions get eaten and not logged if there is a non 500-599 http status error code associated with them. For example, I am using the koala library to communicate with Facebook and the library can raise exceptions with an http status code of 400 if an OAuth token is invalid. I feel like if this happens and my Sinatra application is not rescuing that error, it should appear in the logs in development mode. It doesn't because of the following line in the handle_exception! method:
return res if res or not server_error?

This seems very intentional given Sinatra is relatively mature. Am I off here or does this seem bad to anyone else?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions