Error reference
Every failure mode and what triggers it.
These are every on-chain failure mode a plan can hit. Any one of them reverts the whole transaction. The names and messages below are the exact variants of the program's PtbError enum; Anchor assigns custom error codes starting at 6000 in declaration order.
| Code | Error | When it fires | Fix |
|---|---|---|---|
| 6000 | RegisterOutOfRange | A capture (return_reg) or splice (register) names a slot >= 8. The register file has exactly 8 slots, indexed 0 to 7. | Use a register index in 0 to 7. Keep no more than eight live captured values in a plan. |
| 6001 | SubstitutionOverflow | A splice would write its 8-byte value past the end of the step's data (offset + 8 > data length). | Ensure the step's data is long enough that offset + 8 fits, counting the 8-byte discriminator prefix. |
| 6002 | AccountIndexOutOfRange | A step's program_index or an account index points outside the account pool passed to execute. | Reference only pubkeys you added to the plan; the PlanBuilder interns them, so pass every account a step touches. |
| 6003 | NoReturnData | A step set capture but the callee returned no data via set_return_data, so there is nothing to read. | Only capture from a callee that returns data. Do not set captureInto on a step whose program returns nothing. |
| 6004 | AssertionOutOfRange | A gate assertion reads a range (offset + expected length) past the end of the target account's data. | Point the assertion at a byte range that exists in the account's layout. |
| 6005 | ObligationUnsettled | The end-of-plan gate found an obligation opened in the plan that no later step settled. | Pair every open with a close on the same obligationTag, and make sure the closing step is always reachable. |