Skip to content

Define JSON-RPC error codes #2633

@alexghr

Description

@alexghr

In #2590 we've talked about adding concrete error codes to errors thrown in public RPC methods. This would help RPC clients work better with the node/PXE by handling errors and presenting human friendly information.

I think an enum listing out all error codes would be a good idea. This would make the error codes easy to document and we'd also ensure uniqueness (e.g. so that clients don't get the same error code for two different API errors).

A dedicated AztecError class that takes a code would be thrown in APIs instead of a plain Error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions