Exception: Notifications::Client::RequestError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/notifications/client/request_error.rb

Direct Known Subclasses

ClientError, ServerError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ RequestError

Returns a new instance of RequestError.



6
7
8
9
10
# File 'lib/notifications/client/request_error.rb', line 6

def initialize(response)
  @code = response.code
  @body = parse_body(response.body)
  super(build_message)
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



4
5
6
# File 'lib/notifications/client/request_error.rb', line 4

def body
  @body
end

#codeObject (readonly)

Returns the value of attribute code.



4
5
6
# File 'lib/notifications/client/request_error.rb', line 4

def code
  @code
end