Unverified Commit 3e18e053 authored by Eugen Rochko's avatar Eugen Rochko Committed by GitHub
Browse files

Fix uncaught error when invalid date is supplied to API (#19480)

Fix #19213
parent d2eb7269
Showing with 4 additions and 0 deletions
+4 -0
......@@ -24,6 +24,10 @@ class Api::BaseController < ApplicationController
render json: { error: 'Duplicate record' }, status: 422
end
rescue_from Date::Error do
render json: { error: 'Invalid date supplied' }, status: 422
end
rescue_from ActiveRecord::RecordNotFound do
render json: { error: 'Record not found' }, status: 404
end
......
Supports Markdown
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