Commit a1bf8cc1 by ivan Lan

Add record not found rescue_from

parent 64324db9
...@@ -60,7 +60,11 @@ module Shotengai ...@@ -60,7 +60,11 @@ module Shotengai
rescue_from ActiveRecord::RecordInvalid do |e| rescue_from ActiveRecord::RecordInvalid do |e|
render json: { error: e.message }, status: 400 render json: { error: e.message }, status: 400
end end
rescue_from ActiveRecord::RecordNotFound do |e|
render json: { error: e.message }, status: 404
end
rescue_from AASM::InvalidTransition do |e| rescue_from AASM::InvalidTransition do |e|
render json: { error: e.message }, status: 400 render json: { error: e.message }, status: 400
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment