# `failure.attempt_infallible`

Attempt is used on something that cannot fail.

Area 3, [Logic](../topics/logic.md); not declinable; the next step is usually the agent's.

```jadpo
type Count = Int {}

function plain(n: Count) -> Count {
    return n
}

function wrapper(n: Count) -> Count {
    return attempt plain(n)
}
```

```text
error: `plain(...)` can't fail, so it takes no `attempt`
 --> main.jadpo:8:12
  |
8 |     return attempt plain(n)
  |            ^^^^^^^ nothing to pass on
  reason: `plain(...)` lists no failures after `fails`, so it always gives its result; `attempt` marks only calls that can fail.
  next: Remove `attempt` (agent)
  rule: failure.attempt_infallible
  help: https://jadpo.dev/docs/errors/failure.attempt_infallible

check failed: 1 error, 1 file
```

The outcome-match examples below share a hidden file declaring
`lookup(key: LookupKey) fails LookupMissing, LookupRefused -> LookupResult`.
