Exception: Lapis::Yggdrasil::AuthenticationError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/lapis/yggdrasil/authentication_error.rb

Overview

Information about an error that occurred while interacting with an authentication server.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, message = nil) ⇒ AuthenticationError

Creates a new authentication error.

Parameters:

  • code (Symbol)

    Key used to distinguish from other error types.

  • message (String, nil) (defaults to: nil)

    Information about why the error occurred.



15
16
17
18
# File 'lib/lapis/yggdrasil/authentication_error.rb', line 15

def initialize(code, message = nil)
  super(message)
  @code = code
end

Instance Attribute Details

#codeSymbol (readonly)

Key used to distinguish from other error types.

Returns:

  • (Symbol)

See Also:



10
11
12
# File 'lib/lapis/yggdrasil/authentication_error.rb', line 10

def code
  @code
end

Instance Method Details

#to_sString

Creates a string representation of the error.

Returns:

  • (String)


22
23
24
# File 'lib/lapis/yggdrasil/authentication_error.rb', line 22

def to_s
  "#{code} - #{super}"
end