Class: Datafiniti::Exception
- Inherits:
-
Object
- Object
- Datafiniti::Exception
- Defined in:
- lib/datafiniti/error.rb
Instance Method Summary collapse
-
#initialize(obj, status) ⇒ Exception
constructor
A new instance of Exception.
Constructor Details
#initialize(obj, status) ⇒ Exception
Returns a new instance of Exception.
14 15 16 17 18 19 20 21 |
# File 'lib/datafiniti/error.rb', line 14 def initialize(obj, status) # case status # when 503 then reason = "API is currently unavailable" # when 500 then reason = "A server error has occurred." # else reason = obj.name # end raise obj, "Something went wrong" end |