---
title: When the answer is lost
description: Read a Call terminal, distinguish a lost answer from a refused
  operation, and choose what to tell the caller.
url: https://docs.rastok.com/guide/10-when-the-answer-is-lost
source_revision: v0.2.0-alpha
---

# When the answer is lost

After this chapter you can distinguish “the partner said no” from “we never
heard the answer.” Suppose you send a booking request. You wait, the deadline
passes, and no receipt arrives. The room may still be booked. Starting again
with a different reference could book a second room; telling the guest that
nothing was booked could leave a reservation that nobody knows to cancel.

## What the terminal tells you

A finite outbound Call has one terminal on its `exit` port. Losing the answer
does not create a second port. It changes what you can conclude from the case:

- **No answer arrives.** `TimeoutExpired` says the Call reached its deadline.
  It does not say where the partner was in its work.
- **The answer cannot be used.** An HTTP client may receive an unreadable body
  (`DecodeFailed`), lose the exchange (`ProtocolFailed`), or reach the body
  limit (`BodyTooLarge`). A File or Process has different case names. Check
  the table in its [Connector contract](/reference/contracts.md).
- **The runtime closes the Call without observing its end.** `OutcomeUnknown`
  preserves that uncertainty. Recovery does not silently send the request again.

An outbound [HttpClient](/reference/connectors/http-client.md) can also produce
`DecodeFailed` before sending a request that does not fit its codec.
Read `data.message` after testing `data is DecodeFailed`: a request refusal
names the input, while an unreadable response names the output or the
declared field that did not fit. The message explains the refusal without
copying the value. It is not a receipt: a partner may already have acted
before sending an unreadable response.

## Three responses to the same timeout

Choose what is safe for this particular operation. These choices can go
to the same output as other cases; the important part is to name the case
and decide what the output means.

| Choice | What the booking program does | What its caller learns |
|---|---|---|
| Report uncertainty | Route `TimeoutExpired` and the other lost-answer cases to the branch that emits `Unknown`. | There is no receipt. The caller can decide whether to investigate. |
| Read back | Send a separate lookup with the original booking reference and compare the returned receipt with the request. | A matching receipt confirms the booking without making another one. If the lookup also loses its answer, report the booking as unconfirmed. |
| Retry with a key | Give the Call a stable `idempotency_key`, declare the partner's idempotence guarantee, and select `TimeoutExpired` in `Retry.on`. | The partner can recognize another attempt at the same operation. If the attempts run out, the last terminal still needs a decision. |

A key identifies the operation. It does not by itself make the partner
honor that key. In the [webhook example](/examples/04-webhook-to-partner.md)
the contract with the partner supplies that guarantee. Read
`examples/webhook-to-partner.rkg`, lines 93–95:

```rkg
Retry.attempts = 2
Retry.on = [ServerError, TimeoutExpired, DnsFailed, ConnectFailed]
Retry.delay = { kind = fixed; after = duration("1s") }
```

## Read the warning

If a route sends only `Completed` to a receipt handler and sends `_` to a
failure handler, `rastok check` reports `W-MATCH-CATCHALL` on the underscore.
It does the same for the match in the first Operator that receives the
terminal through a simple route. The diagnostic lists the lost-answer cases
that no arm names. An arm that tests `data is TimeoutExpired` names that case;
the other cases can share one arm. The check follows nested matches. For
example, `data is TimeoutExpired && retrying` does not cover a timeout when
`retrying` is false. A wildcard that writes neither an output nor state
discards the event and is not reported. A handler with no wildcard is not
reported either. The check does not follow the value through another Operator.

## Summary

A timeout is evidence about the answer, not the reservation. Name the
uncertain outcomes and choose whether to report them, look up a receipt,
or repeat an operation under a guarantee. A warning does not change the
plan or its exit status. For implementation limits, see
[What is available today](/index.md#what-is-available-today).

## Next

Run the timeout scenario in [Webhook to partner](/examples/04-webhook-to-partner.md).
Compare its terminal after a successful retry with the last terminal when
the partner never answers. For the repetition rule, return to
[Loops and retries](/guide/07-loops-and-retries.md).
