Exception: Olyx::Guardrails::Blocked

Inherits:
StandardError
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(decision, message = 'content blocked by guardrail policy') ⇒ Blocked

:call-seq:

new(decision, message = "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, message = 'content blocked by guardrail policy')
  @decision = decision
  super(message)
end

Instance Attribute Details

#decisionObject (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