diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-04-06 09:16:40 +0000 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-04-06 09:16:40 +0000 |
commit | 2bf8345542dbdae17c3755ca7157cbaf70ffde41 (patch) | |
tree | 48b9b82e6ae9ed2e12649b4ea4f95b6833948d3a /lib/api/api.rb | |
parent | 99edc15127d9d23475c94079d53e2893f58c042a (diff) | |
parent | 20e9b32c96a5b08e3f61c8974b43977f98d8666e (diff) | |
download | gitlab-ce-2bf8345542dbdae17c3755ca7157cbaf70ffde41.tar.gz |
Merge branch 'master' into '42568-pipeline-empty-state'
# Conflicts:
# app/views/projects/jobs/show.html.haml
# lib/gitlab/ci/status/core.rb
Diffstat (limited to 'lib/api/api.rb')
-rw-r--r-- | lib/api/api.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/api/api.rb b/lib/api/api.rb index 62ffebeacb0..073471b4c4d 100644 --- a/lib/api/api.rb +++ b/lib/api/api.rb @@ -78,6 +78,14 @@ module API rack_response({ 'message' => '404 Not found' }.to_json, 404) end + rescue_from UploadedFile::InvalidPathError do |e| + rack_response({ 'message' => e.message }.to_json, 400) + end + + rescue_from ObjectStorage::RemoteStoreError do |e| + rack_response({ 'message' => e.message }.to_json, 500) + end + # Retain 405 error rather than a 500 error for Grape 0.15.0+. # https://github.com/ruby-grape/grape/blob/a3a28f5b5dfbb2797442e006dbffd750b27f2a76/UPGRADING.md#changes-to-method-not-allowed-routes rescue_from Grape::Exceptions::MethodNotAllowed do |e| |