Skip to main content

Error handling

When a provider returns an error, Lasso decides whether the error belongs to your request or to that provider, and acts on that.

Errors caused by your request

If the request itself is wrong, such as invalid parameters, a malformed envelope or a reverted contract call, every provider would give the same answer. Lasso returns the error to you as-is. A provider can be wrong about that. When one says a read that is safe to repeat had invalid parameters or was malformed, Lasso asks one other provider before returning the error. If that provider answers, you get its result; otherwise you get the original error. Reverted calls and signed transactions are never re-sent this way.

Errors caused by the provider

If the provider is the problem, such as being rate limited, missing the data, not supporting the method, rejecting the range, timing out or failing internally, Lasso tries the next provider. This applies to reads that are safe to repeat. A signed transaction goes to up to three providers in turn, and only provider faults move it on; a sender fault such as nonce too low or insufficient funds stops at the first and is returned to you. Lasso also learns from these errors: a provider that keeps refusing a method, history or span is moved behind alternatives for matching requests. Quota exhaustion and plan refusals take the affected credential out of rotation until revalidation succeeds, keeping the last route.

When no provider can serve the request

Lasso tries a bounded number of providers. If every one fails, you get one Lasso error instead of whichever provider happened to answer last:
  • When every provider rejected an eth_getLogs range, data.code is log_range_limit and next_action says to reduce the block range.
  • When every provider refused an address-less eth_getLogs filter, data.code is log_filter_refused and next_action says to add an address filter. A mix of that refusal with other failures does not use this code.
  • Otherwise data.code is provider_error, and the message says how many providers Lasso tried and the reason they shared.
  • It never includes provider names or a provider’s raw message.
Every code and its fix is listed in response signals and errors.