diff options
author | Connor Shea <connor.james.shea@gmail.com> | 2016-08-02 15:56:27 -0600 |
---|---|---|
committer | Connor Shea <connor.james.shea@gmail.com> | 2016-08-09 09:42:49 -0600 |
commit | c53b599e61027e910aa0425150373cb30c67b150 (patch) | |
tree | 12c040d669f44d7f67f6f0609a5a3892daff1f5d /lib/api/api.rb | |
parent | 6320a83ae8a2e692e62e7e5c56321c98f5f813a6 (diff) | |
download | gitlab-ce-c53b599e61027e910aa0425150373cb30c67b150.tar.gz |
Retain old behavior
Diffstat (limited to 'lib/api/api.rb')
-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| |