class Sinatra::Request

def params

def params
  super
rescue Rack::Utils::ParameterTypeError, Rack::Utils::InvalidParameterError => e
  raise BadRequest, "Invalid query parameters: #{Rack::Utils.escape_html(e.message)}"
end