OSDN Git Service
(root)
/
wvm
/
gitlab.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9fdbdc6
)
rescue all errors and return the proper format
author
Felix Gilcher
<felix.gilcher@asquera.de>
Tue, 29 Jan 2013 17:20:59 +0000
(18:20 +0100)
committer
Felix Gilcher
<felix.gilcher@asquera.de>
Tue, 29 Jan 2013 17:20:59 +0000
(18:20 +0100)
This rescues all errors and returns a proper JSON response. Fixes #2833.
lib/api.rb
patch
|
blob
|
history
diff --git
a/lib/api.rb
b/lib/api.rb
index
f58b82f
..
3dd8271
100644
(file)
--- a/
lib/api.rb
+++ b/
lib/api.rb
@@
-8,6
+8,10
@@
module Gitlab
rack_response({'message' => '404 Not found'}.to_json, 404)
end
+ rescue_from :all do
+ rack_response({'message' => '500 Internal Server Error'}, 500)
+ end
+
format :json
error_format :json
helpers APIHelpers