Exception: Reeve::AuditWriteError
- Defined in:
- lib/reeve/errors.rb
Overview
Raised when the ledger write fails and audit_failure_mode is :fail (FR-012).
It carries a rule like any other denial, because the failure is not recorded anywhere else: the ledger is the thing that failed, so there is no row to read afterwards. The exception is the only artifact, and a host matching on rules can match on this one.
Instance Attribute Summary collapse
-
#during ⇒ Object
readonly
duringis whatever the invocation was already raising when the ledger write failed — usually a DeniedError, sometimes the tool's own exception. -
#invocation_id ⇒ Object
readonly
Returns the value of attribute invocation_id.
-
#original_error ⇒ Object
readonly
Returns the value of attribute original_error.
-
#rule ⇒ Object
readonly
Returns the value of attribute rule.
Instance Method Summary collapse
-
#initialize(invocation_id:, cause: nil, during: nil) ⇒ AuditWriteError
constructor
A new instance of AuditWriteError.
Constructor Details
#initialize(invocation_id:, cause: nil, during: nil) ⇒ AuditWriteError
Returns a new instance of AuditWriteError.
75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/reeve/errors.rb', line 75 def initialize(invocation_id:, cause: nil, during: nil) @invocation_id = invocation_id&.to_s @original_error = cause @during = during @rule = Decision::AUDIT_WRITE_FAILED = "reeve could not record invocation #{@invocation_id}" = "#{}: #{cause.}" if cause if during = "#{} (while the invocation was already failing with " \ "#{during.class}: #{during.})" end super() end |
Instance Attribute Details
#during ⇒ Object (readonly)
during is whatever the invocation was already raising when the ledger write
failed — usually a DeniedError, sometimes the tool's own exception. It is carried
rather than discarded: the audit failure must win, because a call that cannot be
recorded is a failed call, but the developer still needs to see what the call was
doing at the time.
73 74 75 |
# File 'lib/reeve/errors.rb', line 73 def during @during end |
#invocation_id ⇒ Object (readonly)
Returns the value of attribute invocation_id.
66 67 68 |
# File 'lib/reeve/errors.rb', line 66 def invocation_id @invocation_id end |
#original_error ⇒ Object (readonly)
Returns the value of attribute original_error.
66 67 68 |
# File 'lib/reeve/errors.rb', line 66 def original_error @original_error end |
#rule ⇒ Object (readonly)
Returns the value of attribute rule.
66 67 68 |
# File 'lib/reeve/errors.rb', line 66 def rule @rule end |