Exception: Itch::AuthError

Inherits:
Error
  • Object
show all
Defined in:
lib/itch_client.rb

Overview

Authentication errors, includes individual error messages in errors key

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, errors: []) ⇒ AuthError

Returns a new instance of AuthError.



15
16
17
18
# File 'lib/itch_client.rb', line 15

def initialize(message, errors: [])
  super(message)
  @errors = errors
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



13
14
15
# File 'lib/itch_client.rb', line 13

def errors
  @errors
end

Instance Method Details

#messageObject



20
21
22
23
24
25
26
# File 'lib/itch_client.rb', line 20

def message
  m = super

  return "#{m}\n\n#{errors.join("\n")}" if errors.any?

  m
end