failure.duplicate_mapping
Condition is mapped twice.
Area 4, Failures; not declinable; the next step is usually the agent's.
type Quantity = Int { min: 1 max: 1000}type QuantityTooLarge = Failure { kind: FailureKind.invalid_value}function doubled(quantity: Quantity) fails QuantityTooLarge -> Quantity { var result: Quantity = attempt Quantity(quantity * 2) { max: QuantityTooLarge max: QuantityTooLarge } return result}
error max: is mapped twice
--> main.jadpo:13:9
|12 | max: QuantityTooLarge | --- first mapped here13 | max: QuantityTooLarge | ^^^ mapped again
- reason
- Each condition is mapped once, so there is never a question of which failure the caller gets.
- next
- Remove one
max:(agent) - rule
- failure.
duplicate_ mapping - help
- https://jadpo.
dev/docs/errors/failure. duplicate_ mapping
Markdown for agents: /docs/errors/failure.duplicate_mapping.md.Built from Jadpo main at aee2e8f.