Error handling
Classify the failure before you retry. A retry of the wrong operation repeats a provider call, or hides a commit that already happened.
What you see
| What you see | What it means | What to do |
|---|---|---|
| HTTP 422 and a rule message | Preflight rejected. Nothing committed. | Submit a corrected intent. |
ACCEPTED and a timeline id | Ledger and snapshot committed. | Inspect the timeline. Use a query for the projection. |
| Client timeout | The outcome is unknown. | Inspect before you submit again. |
409 PROJECTION_NOT_VISIBLE | The projection does not include that cursor yet. | Read the query again. The intent already committed. |
| Same intent id submitted again | The first commit stands. | Read the timeline for that id. |
| New intent id | A new execution. | Side effects can run again. |
The counter
ADD_TO_COUNTER with delta 0 returned HTTP 422 and Delta must be greater than zero. Nothing was written to the timeline. The same entity later accepted delta 1 and returned timeline id lab-add-1-docs-lab-1795219014. The transcript is in Inspect execution.
causet inspect timeline --entity <id> --stream <stream> --fork <fork>
causet inspect state --entity <id> --stream <stream> --fork <fork>The stream id is the one you submitted. The counter example used stream counter.
Correcting business state
A new intent is how you change business state after a commit. Projection rebuild and replay recompute recorded history. They do not re-run rules and they do not call a provider.
Forensic replay check, recovery stream replay, and repair execution are sandbox preview. The production path for a wrong outcome is inspect, then a new intent. The sandbox commands are in Observability. The 409 path is in Consistency.