Skip to content
Snippets Groups Projects
Unverified Commit 6d7daf61 authored by Eugen Rochko's avatar Eugen Rochko Committed by GitHub
Browse files

Fix generic HTTP 500 error on duplicate records (#12563)

Fix #12551
Fix #12547
parent 1653ae91
No related branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,10 @@ class Api::BaseController < ApplicationController
render json: { error: e.to_s }, status: 422
end
rescue_from ActiveRecord::RecordNotUnique do
render json: { error: 'Duplicate record' }, status: 422
end
rescue_from ActiveRecord::RecordNotFound do
render json: { error: 'Record not found' }, status: 404
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment