Handle ActiveRecord::RecordNotFound
This commit is contained in:
@@ -10,6 +10,10 @@ module Dunlop::Ember::ApiBaseController
|
|||||||
rescue_from CanCan::AccessDenied do
|
rescue_from CanCan::AccessDenied do
|
||||||
render json: {errors: [{status: 403, detail: 'unauthorized'}]}, status: 403
|
render json: {errors: [{status: 403, detail: 'unauthorized'}]}, status: 403
|
||||||
end
|
end
|
||||||
|
|
||||||
|
rescue_from ActiveRecord::RecordNotFound do
|
||||||
|
render json: {data: nil}, status: 404
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
|||||||
Reference in New Issue
Block a user