Exception: WerckerAPI::Error

Inherits:
ArgumentError
  • Object
show all
Defined in:
lib/wercker_api/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Error



5
6
7
8
9
10
11
# File 'lib/wercker_api/client.rb', line 5

def initialize(response)
  json = JSON.parse(response.body)
  msg = <<-EOM
Error: #{json['error']}, status: #{json['statusCode']}, message: #{json['message']}
EOM
  super(msg)
end