Exception: Olyx::Guardrails::Blocked
- Inherits:
-
StandardError
- Object
- StandardError
- Olyx::Guardrails::Blocked
- Defined in:
- lib/olyx/guardrails/errors.rb
Overview
Raised by explicit Rails enforcement entry points when a decision blocks.
Every instance carries a frozen, content-free decision summary. Rescuing Olyx::Guardrails::Blocked also catches low-level secret enforcement because SecretScanner::Blocked is a subclass.
Instance Attribute Summary collapse
-
#decision ⇒ Object
readonly
The frozen, content-free decision summary that caused the exception.
Instance Method Summary collapse
-
#initialize(decision, message = 'content blocked by guardrail policy') ⇒ Blocked
constructor
:call-seq: new(decision, message = "content blocked by guardrail policy").
Constructor Details
#initialize(decision, message = 'content blocked by guardrail policy') ⇒ Blocked
:call-seq:
new(decision, = "content blocked by guardrail policy")
Builds an exception for decision. message is intended for logs and
exception reporting; applications should use #decision for structured
handling.
28 29 30 31 |
# File 'lib/olyx/guardrails/errors.rb', line 28 def initialize(decision, = 'content blocked by guardrail policy') @decision = decision super() end |
Instance Attribute Details
#decision ⇒ Object (readonly)
The frozen, content-free decision summary that caused the exception.
20 21 22 |
# File 'lib/olyx/guardrails/errors.rb', line 20 def decision @decision end |