Skip to main content
A failed POST /compose returns a structured ComposeError:
kind is the discriminator from the union below. message is human-readable. path (when present) names the field in the Flow JSON that triggered the error.

Error kinds

The full ComposeErrorKind union shipped with @lifi/compose-spec:

Recovery hints

  • 400-class kinds indicate a problem the caller must fix: the Flow JSON, the ref grammar, or the input bindings. Re-submitting the same request will fail the same way.
  • 404 (no_route_error) means the routing graph has no edge matching the requested input/output pair on the requested chain. Check Supported Protocols & Chains for current coverage; the targeted vault may not yet be a routing edge.
  • 422-class kinds are runtime / data problems. Adjust tolerances (slippage, maxPriceImpactBps), wait for on-chain state to settle, or surface the error to your user.
  • 500-class kinds are server-side. Retry with backoff; if the error persists, contact LI.FI.

Allow-revert mode

When run.simulationPolicy is "allow-revert", a simulation_revert no longer fails the call. Instead, the response returns the compiled transactionRequest together with the revert diagnostics on the partial result’s simulationRevert field (HTTP 206). Use this when you want to surface the revert reason to the user rather than hide it. See Guards for how guard_error is produced and Execution Model for where each error kind originates in the compile pipeline.

See also

  • Execution Model β€” pipeline stages that emit each error kind.
  • Guards β€” observation-to-assertion mechanism behind guard_error.
  • Flow wire format β€” the request and response shape returned by POST /compose.