sinatra / sinatra

Classy web-development dressed in a DSL (official / canonical repo)

Home Page:https://sinatrarb.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Handling custom error

ta opened this issue · comments

Hello,

I use the custom errors strategy to handle request data validation - it works great.

However, I was wondering if the whole flow with raise/rescue with stacktraces etc. can be avoided using throw/catch. I did some inspection of the Sinatra::Base class, and I can see that throw/catch is used for halting.

I can't seem to find any way for me to use throw/catch instead of letting something raised be rescued and handled by handle_exception!.

Am I missing something or would this be a good feature request?