diff options
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/api.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/api/api.rb b/lib/api/api.rb index bd16806892b..6cd4a853dbe 100644 --- a/lib/api/api.rb +++ b/lib/api/api.rb @@ -7,8 +7,10 @@ module API rack_response({ 'message' => '404 Not found' }.to_json, 404) end - rescue_from Grape::Exceptions::ValidationErrors do |e| - error!({ messages: e.full_messages }, 400) + # Retain 405 error rather than a 500 error for Grape 0.15.0+. + # See: https://github.com/ruby-grape/grape/commit/252bfd27c320466ec3c0751812cf44245e97e5de + rescue_from Grape::Exceptions::Base do |e| + error! e.message, e.status, e.headers end rescue_from :all do |exception| |