Method: Booqable::Error.error_for_422
- Defined in:
- lib/booqable/error.rb
.error_for_422(body) ⇒ Object
Return most appropriate error for 422 HTTP status code rubocop:disable Naming/VariableNumber
155 156 157 158 159 160 161 162 163 164 165 |
# File 'lib/booqable/error.rb', line 155 def self.error_for_422(body) # rubocop:enable Naming/VariableNumber case body when /is not a datetime/i Booqable::InvalidDateTimeFormat when /invalid date/i Booqable::InvalidDateFormat else Booqable::UnprocessableEntity end end |