summaryrefslogtreecommitdiff
path: root/lib/api/api.rb
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2018-04-03 18:47:33 +0200
committerKamil Trzciński <ayufan@ayufan.eu>2018-04-05 15:01:14 +0200
commit678620cce67cc283b19b75137f747f9415aaf942 (patch)
tree650b53c790087b88ce40f79c7c66cef6994c25b4 /lib/api/api.rb
parent9b1677b2deeec1faf0dd1d60a2b0c47e80b58433 (diff)
downloadgitlab-ce-direct-upload-of-artifacts.tar.gz
Add `direct_upload` setting for artifactsdirect-upload-of-artifacts
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|