Commit efa21573df1f2db9421081d354fdefd2b675e488

Authored by Nihad Abbasov
1 parent f086676b

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 5 VERSION = 'v2'
6 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 12 format :json
9 13 error_format :json
10 14 helpers APIHelpers
... ...