app/controllers/application_controller.rb
def rescue_pg_invalid_query(exception)
    case exception.cause
    when PG::DatetimeFieldOverflow, PG::NumericValueOutOfRange
      head :bad_request
    else
      raise exception
    end
  end
# FIXME: better error handling instead of blank 400.
better error handling instead of blank 400.
better error handling instead of blank 400 .
def rescue_pg_invalid_query(exception)
    case exception.cause
    when PG::DatetimeFieldOverflow, PG::NumericValueOutOfRange
      head :bad_request
    else
      raise exception
    end
  end
def rescue_pg_invalid_query ( exception ) case exception . cause when PG :: DatetimeFieldOverflow , PG :: NumericValueOutOfRange head :bad_request else raise exception end end
FIXME: better error handling instead of blank 400.
FIXME : better error handling instead of blank 400 .
exception