From efa21573df1f2db9421081d354fdefd2b675e488 Mon Sep 17 00:00:00 2001 From: Nihad Abbasov Date: Thu, 5 Jul 2012 08:12:09 -0700 Subject: [PATCH] return 404 when record not found --- lib/api.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/api.rb b/lib/api.rb index 309d254b..e24e0a78 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