Exception: Payu::ApiError

Inherits:
PayuError
  • Object
show all
Defined in:
lib/payu/errors.rb

Overview

Raised by Payu::Http. Carries the HTTP status and raw body when available so callers can distinguish failure modes instead of pattern matching on the message.

Direct Known Subclasses

NetworkError, ResponseError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg = nil, status: nil, body: nil) ⇒ ApiError

Returns a new instance of ApiError.



14
15
16
17
18
# File 'lib/payu/errors.rb', line 14

def initialize(msg = nil, status: nil, body: nil)
  super(msg)
  @status = status
  @body = body
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



12
13
14
# File 'lib/payu/errors.rb', line 12

def body
  @body
end

#statusObject (readonly)

Returns the value of attribute status.



12
13
14
# File 'lib/payu/errors.rb', line 12

def status
  @status
end