There are few places in the code that we raise an exception instead of throw :error and vice-versa.
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.
There are few places in the code that we
raisean exception instead of throw:errorand vice-versa.throwandexceptionare dealt by error_response inGrape::Middleware::ErrorandGrape::Exceptions::Baseneeds the[]operator so the code can work when itsHashor `Exception. This is really confusing.We should be consistent in the code base since we mostly treat
throwlike exception. For instance, when dealing withGrape::Exceptions::ValidationErrors, we rescue them throughrescue_fromandthrowand:errorafterward with thebacktraceandoriginal_exception.