οΈ Error Type Annotation on Failure Edges (v1.40.0)
For body-scan pipelines (Result<T>), REslava.ResultFlow now annotates failure edges with the error type name when a step argument is a direct error constructor or static factory call.
[ResultFlow]
public Result<Order> Process(CreateOrderCmd cmd) =>
FindUser(cmd.UserId)
.Ensure(u => u.IsActive, new NotFoundError("User inactive"))
.Bind(u => ReserveInventory(cmd, u))
.Ensure(o => o.HasStock, ConflictError.Duplicate<Product>("sku", cmd.Sku))
.Map(o => ValidateAddress(o))
.Ensure(o => o.AddressIsValid, ValidationError.Field("Address", "Invalid"))
.Bind(o => SaveOrder(o));
Generated Mermaid diagram β failure edges now show the error type:
flowchart LR
N0_FindUser["FindUser"] -->|pass| N1_Ensure
N1_Ensure["Ensure"] -->|pass| N2_ReserveInventory
N1_Ensure -->|"fail: NotFoundError"| F1["Failure"]
N2_ReserveInventory["ReserveInventory"] -->|ok| N3_Ensure
N2_ReserveInventory -->|"fail"| F2["Failure"]
N3_Ensure["Ensure"] -->|pass| N4_ValidateAddress
N3_Ensure -->|"fail: ConflictError"| F3["Failure"]
...
For Result<T, TError> typed pipelines, the error type comes from the generic return type (semantic, exact) and always takes precedence over the syntactic extraction.