Exception: Kidspire::PcoApiError

Inherits:
PcoError show all
Defined in:
lib/kidspire/errors.rb

Overview

non-2xx from PCO API

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of PcoApiError.



7
8
9
10
11
# File 'lib/kidspire/errors.rb', line 7

def initialize(msg = nil, status: nil, body: nil)
  @status = status
  @body   = body
  super(msg || "PCO API error (#{status})")
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



6
7
8
# File 'lib/kidspire/errors.rb', line 6

def body
  @body
end

#statusObject (readonly)

Returns the value of attribute status.



6
7
8
# File 'lib/kidspire/errors.rb', line 6

def status
  @status
end