Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
c53b599e
Commit
c53b599e
authored
Aug 02, 2016
by
Connor Shea
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Retain old behavior
parent
6320a83a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
lib/api/api.rb
lib/api/api.rb
+4
-2
No files found.
lib/api/api.rb
View file @
c53b599e
...
@@ -7,8 +7,10 @@ module API
...
@@ -7,8 +7,10 @@ module API
rack_response
({
'message'
=>
'404 Not found'
}.
to_json
,
404
)
rack_response
({
'message'
=>
'404 Not found'
}.
to_json
,
404
)
end
end
rescue_from
Grape
::
Exceptions
::
ValidationErrors
do
|
e
|
# Retain 405 error rather than a 500 error for Grape 0.15.0+.
error!
({
messages:
e
.
full_messages
},
400
)
# See: https://github.com/ruby-grape/grape/commit/252bfd27c320466ec3c0751812cf44245e97e5de
rescue_from
Grape
::
Exceptions
::
Base
do
|
e
|
error!
e
.
message
,
e
.
status
,
e
.
headers
end
end
rescue_from
:all
do
|
exception
|
rescue_from
:all
do
|
exception
|
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment