Exception: RubyPi::AuthenticationError

Inherits:
ApiError
  • Object
show all
Defined in:
lib/ruby_pi/errors.rb

Overview

Raised when authentication fails (HTTP 401 or 403). Typically indicates an invalid, expired, or missing API key.

Instance Attribute Summary

Attributes inherited from ApiError

#response_body, #status_code

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, response_body: nil) ⇒ AuthenticationError

Returns a new instance of AuthenticationError.

Parameters:

  • message (String) (defaults to: nil)

    human-readable error description

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

    raw response body



47
48
49
# File 'lib/ruby_pi/errors.rb', line 47

def initialize(message = nil, response_body: nil)
  super(message || "Authentication failed — check your API key", status_code: 401, response_body: response_body)
end