Exception: Rublox::Errors::UnhandledStatusCodeError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/rublox/util/errors.rb

Overview

Exception raised when an unhandled status code is returned.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status_code, errors = "") ⇒ UnhandledStatusCodeError

Returns a new instance of UnhandledStatusCodeError.

Parameters:

  • status_code (Integer)
  • errors (String, nil) (defaults to: "")


95
96
97
98
99
# File 'lib/rublox/util/errors.rb', line 95

def initialize(status_code, errors = "")
  super("Unhandled status code #{status_code}.\nRoblox errors:\n#{errors}")
  @status_code = status_code
  @errors = errors
end

Instance Attribute Details

#errorsString (readonly)

Returns a string containing all the errors returned by the API neatly formatted.

Returns:

  • (String)

    a string containing all the errors returned by the API neatly formatted



91
92
93
# File 'lib/rublox/util/errors.rb', line 91

def errors
  @errors
end

#status_codeHTTP::Response::Status (readonly)

Returns the unhandled status code.

Returns:

  • (HTTP::Response::Status)

    the unhandled status code



87
88
89
# File 'lib/rublox/util/errors.rb', line 87

def status_code
  @status_code
end