summaryrefslogtreecommitdiff
path: root/lib/api/api.rb
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2018-04-06 12:11:24 +0100
committerFilipa Lacerda <filipa@gitlab.com>2018-04-06 12:11:24 +0100
commit99b6506df8656fe09f37067c99121786733a6016 (patch)
tree6a3dcf3f9dcd5d85b4830c3352a873d16507e243 /lib/api/api.rb
parent7fa7ea4b8b55df66ae17c21d64cf30cf571dea9a (diff)
parent41ee09c9a06b41d904977def6e7824928f27596a (diff)
downloadgitlab-ce-fl-fix-annoying-actions.tar.gz
Merge branch 'master' into fl-fix-annoying-actionsfl-fix-annoying-actions
* master: (91 commits) [Rails5] Update `type_cast_*_database` methods Add confirmation modal to "Change username" Add noteableType to mock data object Set `noteable_type` to use in notesApp Return noteableType from app initial config Use noteable type map from constants Add map for supported noteable types Polish design of domain verification for Gitlab Pages Add changelog item Resolve "Show `failure_reason` and upgrade tooltips of jobs" Include subgroup issues when searching for group issues using the API Use the GitLab version as part of the appearances cache key Fix rubocop Fix rubocop Deleting a MR you are assigned to should decrements counter Improve specs and docs Fix more specs Fix specs Show issues of subgroups in group-level issue board Override the Prometheus server name ...
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|