Class: ChronoForge::Executor::ExecutionTracker
- Inherits:
-
Object
- Object
- ChronoForge::Executor::ExecutionTracker
- Defined in:
- lib/chrono_forge/executor/execution_tracker.rb
Constant Summary collapse
- MAX_CONTEXT_BYTESIZE =
Total budget for the context snapshot copied into each error log. Transient errors can be logged repeatedly (one row per retry), and the full context always remains on the workflow itself, so the error copy only needs to be a bounded diagnostic breadcrumb. Keys are preserved; values are kept until the running total would exceed this budget, after which each remaining value is replaced by OMITTED_VALUE. Per-value size is already bounded by Context validation, so no per-value truncation is needed here — a single value larger than the budget is simply replaced.
64.kilobytes
- OMITTED_VALUE =
Placeholder stored in place of a value that didn’t fit the budget.
"<<omitted>>"
Class Method Summary collapse
Class Method Details
.track_error(workflow, error, execution_log: nil, attempt: nil) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/chrono_forge/executor/execution_tracker.rb', line 23 def self.track_error(workflow, error, execution_log: nil, attempt: nil) ErrorLog.create!( workflow: workflow, step_name: execution_log&.step_name, attempt: attempt || execution_log&.attempts, error_class: error.class.name, error_message: error., backtrace: error.backtrace&.join("\n"), context: error_context(workflow.context) ) end |