Class: Verikloak::BFF::Error
- Inherits:
-
Error
- Object
- Error
- Verikloak::BFF::Error
- Defined in:
- lib/verikloak/bff/errors.rb
Overview
Base error class with HTTP status and short code.
Inherits from Error so that rescue Verikloak::Error catches all
Verikloak gem errors uniformly.
Direct Known Subclasses
ClaimsMismatchError, HeaderMismatchError, MissingForwardedTokenError, UntrustedProxyError
Instance Attribute Summary collapse
-
#code ⇒ String
readonly
The current value of code.
-
#http_status ⇒ Integer
readonly
The current value of http_status.
Instance Method Summary collapse
-
#initialize(message = nil, code: 'bff_error', http_status: 401) ⇒ void
constructor
Build a BFF error with a stable code and HTTP status.
Constructor Details
#initialize(message = nil, code: 'bff_error', http_status: 401) ⇒ void
Build a BFF error with a stable code and HTTP status.
23 24 25 |
# File 'lib/verikloak/bff/errors.rb', line 23 def initialize( = nil, code: 'bff_error', http_status: 401) super( || code, code: code, http_status: http_status) end |
Instance Attribute Details
#code ⇒ String (readonly)
Returns the current value of code.
16 17 18 |
# File 'lib/verikloak/bff/errors.rb', line 16 def code @code end |
#http_status ⇒ Integer (readonly)
Returns the current value of http_status.
16 17 18 |
# File 'lib/verikloak/bff/errors.rb', line 16 def http_status @http_status end |