Variant

handler-error

Why a batch was not handled.

A variant rather than types.error, for two reasons. The host requires one: a provider imports this for a workload to export, and the call can trap or the workload can stop mid-call, so the host has to be able to build the error arm itself to report that — which it cannot do for a record. And it is the better shape regardless, because the distinction below is the one thing the handler knows and the provider cannot infer. Without it a provider can only count attempts and hope.

variant handler-error {
  transient(option​<string>),
  permanent(option​<string>),
}

Cases

CasePayloadDescription
transientoption​<string>

Try again. The batch may succeed later — a dependency was unavailable, a lock was held, a quota was spent.

permanentoption​<string>

Do not try again. This batch will never succeed, so redelivering it only stalls the partition behind it; dead-letter it now.