summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-08-09 17:29:45 +0000
committerRémy Coutable <remy@rymai.me>2016-08-09 17:29:45 +0000
commit11a60096f6f60a383dc73ffd87384f078f27b0f6 (patch)
tree5903df84b19ca86f24f2f4e6a6730f1f44f5fdde /lib/api
parentb8130d42c212a45ad1e568f191337f0bed0a3d01 (diff)
parentda29a55d81d0cc24af513a00d08bee4d920061de (diff)
downloadgitlab-ce-11a60096f6f60a383dc73ffd87384f078f27b0f6.tar.gz
Merge branch 'upgrade-grape' into 'master'
Update Grape from 0.13.0 to 0.15.0 Changelog: https://github.com/ruby-grape/grape/blob/v0.15.0/CHANGELOG.md Working on #18226. See merge request !4601
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/api.rb6
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|