sinatra: Exceptions with http status code 400 ignore exception settings

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?

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 27 (15 by maintainers)

Commits related to this issue

Most upvoted comments

Closed by #1519. Will be released in v3.0.

@zzak That’s what I’m proposing. I’ll put a PR together.