Commit efa21573df1f2db9421081d354fdefd2b675e488
1 parent
f086676b
Exists in
master
and in
4 other branches
return 404 when record not found
Showing
1 changed file
with
4 additions
and
0 deletions
Show diff stats
lib/api.rb
@@ -5,6 +5,10 @@ module Gitlab | @@ -5,6 +5,10 @@ module Gitlab | ||
5 | VERSION = 'v2' | 5 | VERSION = 'v2' |
6 | version VERSION, :using => :path | 6 | version VERSION, :using => :path |
7 | 7 | ||
8 | + rescue_from ActiveRecord::RecordNotFound do | ||
9 | + rack_response({'message' => '404 Not found'}.to_json, 404) | ||
10 | + end | ||
11 | + | ||
8 | format :json | 12 | format :json |
9 | error_format :json | 13 | error_format :json |
10 | helpers APIHelpers | 14 | helpers APIHelpers |