Skip to content

Bug: Failed transactions don’t return consistent structured errors #2572

@anthill-aces

Description

@anthill-aces

Describe the bug and the steps to reproduce it

When an on-chain transaction fails (e.g., user rejects the transaction, insufficient funds, or a revert occurs), OnchainKit does not always return a consistent, structured error object to the caller. In some cases, the error is only logged to the console or returned in a non-descriptive form that lacks clear error codes or context, making programmatic handling and UI feedback difficult.
Steps to reproduce:

  1. Integrate OnchainKit in a project with a transaction submission flow.
  2. Connect a wallet using the provided wallet components.
  3. Trigger a transaction that is expected to fail (e.g., send with insufficient balance or cause a revert).
  4. Inspect the error seen in the app code (e.g., via try/catch or error handler).
  5. Notice that the error is generic or lacks structured details.

What's the expected behavior?

OnchainKit should consistently return structured, descriptive errors for all transaction failure cases. Errors should include meaningful fields such as error type, failure reason, and relevant context so that applications can handle them programmatically and provide appropriate feedback to users.

What version of the libraries are you using?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions