Exception: LogtoError::ResponseError

Inherits:
LogtoError
  • Object
show all
Defined in:
lib/logto/core/errors.rb

Overview

The base class for response errors from Logto server.

Direct Known Subclasses

RevocationError, TokenError, UserInfoError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, response: nil) ⇒ ResponseError

Returns a new instance of ResponseError.

Raises:

  • (ArgumentError)


13
14
15
16
17
# File 'lib/logto/core/errors.rb', line 13

def initialize(message, response: nil)
  raise ArgumentError, "response must be a Net::HTTPResponse or nil" unless response.nil? || response.is_a?(Net::HTTPResponse)
  super(message)
  @response = response
end

Instance Attribute Details

#responseNet::HTTPResponse?

The response object that caused this error.

Returns:

  • (Net::HTTPResponse, nil)

    the current value of response



10
11
12
# File 'lib/logto/core/errors.rb', line 10

def response
  @response
end