-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
There are few places in the code that we raise
an exception instead of throw :error
and vice-versa.
- Grape::Middleware::Versioner::AcceptVersionHeader middleware is throwing but Grape::Middleware::Versioner::Header is raising.
- Running validators is raising.
- Both
throw
andexception
are dealt by error_response inGrape::Middleware::Error
andGrape::Exceptions::Base
needs the[]
operator so the code can work when itsHash
or `Exception. This is really confusing.
We should be consistent in the code base since we mostly treat throw
like exception. For instance, when dealing with Grape::Exceptions::ValidationErrors
, we rescue them through rescue_from
and throw
and :error
afterward with the backtrace
and original_exception
.
Metadata
Metadata
Assignees
Labels
No labels