return 404 when record not found
This commit is contained in:
parent
f086676b7c
commit
efa21573df
1 changed files with 4 additions and 0 deletions
|
@ -5,6 +5,10 @@ module Gitlab
|
||||||
VERSION = 'v2'
|
VERSION = 'v2'
|
||||||
version VERSION, :using => :path
|
version VERSION, :using => :path
|
||||||
|
|
||||||
|
rescue_from ActiveRecord::RecordNotFound do
|
||||||
|
rack_response({'message' => '404 Not found'}.to_json, 404)
|
||||||
|
end
|
||||||
|
|
||||||
format :json
|
format :json
|
||||||
error_format :json
|
error_format :json
|
||||||
helpers APIHelpers
|
helpers APIHelpers
|
||||||
|
|
Loading…
Add table
Reference in a new issue