summaryrefslogtreecommitdiff
path: root/lib/api/api.rb
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2018-04-05 20:59:40 +0000
committerGrzegorz Bizon <grzegorz@gitlab.com>2018-04-05 20:59:40 +0000
commitdd271e246001a06609592eef109d154291305d32 (patch)
tree279ef8877a1a7507d26c042810410f6362114e35 /lib/api/api.rb
parente9e800f5239f5b45984d49615bbc67e823a117ab (diff)
parent678620cce67cc283b19b75137f747f9415aaf942 (diff)
downloadgitlab-ce-dd271e246001a06609592eef109d154291305d32.tar.gz
Merge branch 'direct-upload-of-artifacts' into 'master'
Direct upload of artifacts See merge request gitlab-org/gitlab-ce!18160
Diffstat (limited to 'lib/api/api.rb')
-rw-r--r--lib/api/api.rb8
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|