diff options
author | Nihad Abbasov <narkoz.2008@gmail.com> | 2012-07-05 08:12:09 -0700 |
---|---|---|
committer | Nihad Abbasov <narkoz.2008@gmail.com> | 2012-07-05 08:12:09 -0700 |
commit | efa21573df1f2db9421081d354fdefd2b675e488 (patch) | |
tree | d49649a00422e476f30d2500fb470555245c089a /lib/api.rb | |
parent | f086676b7c02dc9958fa9c7f6135142523f65bfc (diff) | |
download | gitlab-ce-efa21573df1f2db9421081d354fdefd2b675e488.tar.gz |
return 404 when record not found
Diffstat (limited to 'lib/api.rb')
-rw-r--r-- | lib/api.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/api.rb b/lib/api.rb index 309d254ba3d..e24e0a78f71 100644 --- a/lib/api.rb +++ b/lib/api.rb @@ -5,6 +5,10 @@ module Gitlab VERSION = 'v2' version VERSION, :using => :path + rescue_from ActiveRecord::RecordNotFound do + rack_response({'message' => '404 Not found'}.to_json, 404) + end + format :json error_format :json helpers APIHelpers |