Exception: ShedCloud::PartnerApi::AuthError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/shedcloud/partner_api/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, status:, body: nil, code: nil) ⇒ AuthError

Returns a new instance of AuthError.



34
35
36
37
38
39
# File 'lib/shedcloud/partner_api/errors.rb', line 34

def initialize(message, status:, body: nil, code: nil)
  @status = status
  @body = body
  @code = code
  super(format_message(message))
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



32
33
34
# File 'lib/shedcloud/partner_api/errors.rb', line 32

def body
  @body
end

#codeObject (readonly)

Returns the value of attribute code.



32
33
34
# File 'lib/shedcloud/partner_api/errors.rb', line 32

def code
  @code
end

#statusObject (readonly)

Returns the value of attribute status.



32
33
34
# File 'lib/shedcloud/partner_api/errors.rb', line 32

def status
  @status
end

Instance Method Details

#unauthorized?Boolean

Returns:

  • (Boolean)


41
# File 'lib/shedcloud/partner_api/errors.rb', line 41

def unauthorized? = status == 401