Exception: DilisensePepClient::ConfigurationError
- Defined in:
- lib/dilisense_pep_client/errors.rb
Overview
Raised when there’s a problem with gem configuration Usually means the API key is missing or invalid
Instance Attribute Summary
Attributes inherited from Error
#context, #error_code, #request_id, #timestamp
Instance Method Summary collapse
-
#initialize(message, config_key: nil, config_value: nil, **options) ⇒ ConfigurationError
constructor
A new instance of ConfigurationError.
- #security_event? ⇒ Boolean
Methods inherited from Error
Constructor Details
#initialize(message, config_key: nil, config_value: nil, **options) ⇒ ConfigurationError
Returns a new instance of ConfigurationError.
78 79 80 81 82 83 84 85 |
# File 'lib/dilisense_pep_client/errors.rb', line 78 def initialize(, config_key: nil, config_value: nil, **) context = { config_key: config_key, config_value: sanitize_config_value(config_value) }.merge(.fetch(:context, {})) super(, error_code: "CONFIG_ERROR", context: context, **) end |
Instance Method Details
#security_event? ⇒ Boolean
87 88 89 |
# File 'lib/dilisense_pep_client/errors.rb', line 87 def security_event? context[:config_key]&.to_s&.match?(/api_key|secret|token/) end |