class JustGiving::Error::RaiseError

Public Instance Methods

on_complete(env) click to toggle source
# File lib/justgiving/error.rb, line 14
def on_complete(env)
  status = env[:status]
  if status >= 400
    case status 
    when 400
      raise Error::BadRequest
    when 404
      raise Error::NoResults
    else
      raise Error::InternalServerError # Treat any other errors as 500
    end
  end
end