Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Register
Sign in
Toggle navigation
Menu
Open sidebar
Tiger Ton
mastodon
Commits
3e18e053
Unverified
Commit
3e18e053
authored
2 years ago
by
Eugen Rochko
Committed by
GitHub
2 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Fix uncaught error when invalid date is supplied to API (#19480)
Fix #19213
parent
d2eb7269
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/controllers/api/base_controller.rb
+4
-0
app/controllers/api/base_controller.rb
with
4 additions
and
0 deletions
+4
-0
app/controllers/api/base_controller.rb
+
4
-
0
View file @
3e18e053
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets