Exception: DilisensePepClient::AuthenticationError

Inherits:
APIError
  • Object
show all
Defined in:
lib/dilisense_pep_client/errors.rb

Overview

Raised specifically for authentication failures (401 status) Usually means the API key is invalid or has been revoked

Examples:

Invalid API key

# This raises AuthenticationError for invalid API key
DilisensePepClient.configure do |config|
  config.api_key = "invalid_key"
end
DilisensePepClient.check_individual(names: "Test")  # => AuthenticationError

Instance Attribute Summary

Attributes inherited from APIError

#body, #headers, #status

Attributes inherited from Error

#context, #error_code, #request_id, #timestamp

Instance Method Summary collapse

Methods inherited from APIError

#client_error?, #server_error?

Methods inherited from Error

#to_h

Constructor Details

#initialize(message, **options) ⇒ AuthenticationError

Returns a new instance of AuthenticationError.



218
219
220
# File 'lib/dilisense_pep_client/errors.rb', line 218

def initialize(message, **options)
  super(message, error_code: "AUTH_ERROR", **options)
end

Instance Method Details

#retryable?Boolean

Returns:

  • (Boolean)


226
227
228
# File 'lib/dilisense_pep_client/errors.rb', line 226

def retryable?
  false # Auth errors should not be retried automatically
end

#security_event?Boolean

Returns:

  • (Boolean)


222
223
224
# File 'lib/dilisense_pep_client/errors.rb', line 222

def security_event?
  true
end