Class: Datafiniti::Exception

Inherits:
Object
  • Object
show all
Defined in:
lib/datafiniti/error.rb

Instance Method Summary collapse

Constructor Details

#initialize(obj, status) ⇒ Exception

Returns a new instance of Exception.

Raises:

  • (obj)


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