Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Propagate extrinsic errors over JSON-RPC for locally submitted transactions #2246

@foby

Description

@foby

Extrinsic errors raised within module functions are not propagated over the JSON-RPC interface. The executor indeed handles those errors by sending an ExtrinsicFailed event. But that event doesn't carry any further information about the error.

Example:

In our module transaction we raise this error:

return Err("my_error_code")

And on the client side the transaction result is like:

{
  "events": [
    {
      "phase": {
        "ApplyExtrinsic": 1
      },
      "event": {
        "index": "0x0001",
        "data": []
      }
    }
  ],
  "status": {
    "Finalised": "0xf813791343ba383cb28e4a4b2df2e2948bff1c973de93c1ce404d5d78c335d70"
  },
  "type": "Finalised"
}

So we get the ExtrinsicFailed event (0x0001) but with an empty data field.

Suggestion:
Is it possible to encode the error object into the data field of the event record?

Metadata

Metadata

Assignees

No one assigned

    Labels

    J0-enhancementAn additional feature request.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions