# `failure.duplicate_mapping`

Condition is mapped twice.

Area 4, [Failures](../topics/failures.md); not declinable; the next step is usually the agent's.

```jadpo
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
}
```

```text
error: `max:` is mapped twice
 --> main.jadpo:13:9
   |
12 |         max: QuantityTooLarge
   |         --- first mapped here
13 |         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

check failed: 1 error, 1 file
```
