2.2 KiB
2.2 KiB
id, name, status, depends_on, scope, risk, impact, level
| id | name | status | depends_on | scope | risk | impact | level | |
|---|---|---|---|---|---|---|---|---|
| error/hierarchy | Implement FlowgraphError hierarchy with all error classes and validation result types | completed |
|
narrow | low | component | implementation |
Description
Implement the complete error hierarchy per error-handling.md. This includes thrown error classes (for construction invariant violations) and structured result types (for validation functions that never throw).
Acceptance Criteria
src/error/index.tsexports all error classes and result typesFlowgraphErrorbase class extendingErrorwithname: "FlowgraphError"ConstructionErrorextendingFlowgraphError— base for construction-time errorsDuplicateNodeErrorextendingConstructionError—keypropertyDuplicateEdgeErrorextendingConstructionError—source,targetpropertiesNodeNotFoundErrorextendingConstructionError—keypropertyCycleErrorextendingConstructionError—cycles: string[][]propertyInvalidInputErrorextendingConstructionError—errors: ValidationError[]propertyInvalidTransitionErrorextendingFlowgraphError—requestId,from: CallStatus,to: CallStatuspropertiesValidationErrorinterface —{ type: "schema", nodeKey, field, message, value? }GraphValidationErrorinterface —{ type: "graph", category: "cycle" | "dangling-reference" | "orphan-node" | "status-inconsistency", details: unknown }TypeIncompatErrorinterface —{ type: "type-compat", sourceKey, targetKey, compatible: false, mismatches: TypeMismatch[] }TypeMismatchinterface —{ path, expected, actual }AnyValidationErrorunion type —ValidationError | GraphValidationError | TypeIncompatError- Throwing vs returning contract clearly documented in JSDoc
- Unit tests: each error class constructs correctly, result types validate,
instanceofchecks work
References
- docs/architecture/error-handling.md — complete error hierarchy, throwing vs returning contract
Notes
To be filled by implementation agent
Summary
To be filled on completion