Exception: Verikloak::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Verikloak::Error
- Defined in:
- lib/verikloak/errors.rb
Overview
Base error class for all Verikloak-related exceptions.
All errors raised by this library inherit from this class so they can be rescued in a consistent way. Each error may carry a short, programmatic ‘code` (e.g., “invalid_token”, “jwks_fetch_failed”) that middleware and callers can use to map to HTTP statuses or telemetry.
Direct Known Subclasses
DiscoveryError, JwksCacheError, MiddlewareError, TokenDecoderError
Instance Attribute Summary collapse
-
#code ⇒ String, ...
readonly
A short error code identifier suitable for programmatic handling.
-
#http_status ⇒ Integer?
readonly
HTTP status code associated with the error (e.g. 401, 403, 500, 503).
Instance Method Summary collapse
-
#initialize(message = nil, code: nil, http_status: nil) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(message = nil, code: nil, http_status: nil) ⇒ Error
Returns a new instance of Error.
26 27 28 29 30 |
# File 'lib/verikloak/errors.rb', line 26 def initialize( = nil, code: nil, http_status: nil) super() @code = code @http_status = http_status end |
Instance Attribute Details
#code ⇒ String, ... (readonly)
A short error code identifier suitable for programmatic handling.
20 21 22 |
# File 'lib/verikloak/errors.rb', line 20 def code @code end |
#http_status ⇒ Integer? (readonly)
HTTP status code associated with the error (e.g. 401, 403, 500, 503).
20 21 22 |
# File 'lib/verikloak/errors.rb', line 20 def http_status @http_status end |