Exception: Digitalocean::ClientError

Inherits:
Error
  • Object
show all
Defined in:
lib/digitalocean/errors.rb

Instance Attribute Summary collapse

Attributes inherited from Error

#code

Instance Method Summary collapse

Methods inherited from Error

#message, #to_s

Constructor Details

#initialize(response) ⇒ ClientError

Returns a new instance of ClientError.



32
33
34
35
36
37
38
# File 'lib/digitalocean/errors.rb', line 32

def initialize(response)
  @message = response.json["message"]
  @id      = response.json["id"]
  @code    = response.status
rescue StandardError
  @message = "Uncatched Error"
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



30
31
32
# File 'lib/digitalocean/errors.rb', line 30

def id
  @id
end