mirror of
https://github.com/hakanensari/frankfurter.git
synced 2024-11-22 02:52:49 +01:00
Update rescued exception
The converter API allows the date as parameter and it needs to be rescued with an invalid date, and the exception is `PG::InvalidDatetimeFormat`, so the safest solution was to use the first ancestor of this exception which is the same one as the current `PG::DatetimeFieldOverflow`.
This commit is contained in:
parent
ad64574745
commit
597792c988
@ -35,7 +35,7 @@ class Quote
|
||||
raise Invalid, 'Date too old' unless current_date
|
||||
@date = current_date
|
||||
rescue Sequel::DatabaseError => ex
|
||||
if ex.wrapped_exception.is_a?(PG::DatetimeFieldOverflow)
|
||||
if ex.wrapped_exception.is_a?(PG::DataException)
|
||||
raise Invalid, 'Invalid date'
|
||||
else
|
||||
raise
|
||||
|
Loading…
Reference in New Issue
Block a user