Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Error handling: retrieve variables used by failed instruction #187

@folex

Description

@folex

When instructions fail, it might look like this:

 {
      "instruction": "call flattened.$.[0].peer_id (flattened.$.[0].service_id.[0] \"getPublicUser\") [] user",
      "msg": "value '[{\"peer_id\":\"12D3KooWGmJSe6Sd9ART9X5Lw6NtAZBWgcjSPHVkSgiHsNQQaMhJ\",\"relay_id\":[\"12D3KooWAPryc7ZKpbPPhEdHjLiHZYzHGYPkQGBwE77R2eRLMUtQ\"],\"service_id\":[\"8d802ce1-df37-41b3-ad94-a9984b44126d\"],\"set_by\":\"12D3KooWEWFQsdrXaUsUoX4M1V4U8gd7nHoB3j6ZSZAyaD8S3ido\",\"timestamp_created\":1638879987,\"value\":\"vc solution\",\"weight\":10000}]' is not an map-type to match field algebra with field_name = 'peer_id'",
      "peer_id": "12D3KooWEWFQsdrXaUsUoX4M1V4U8gd7nHoB3j6ZSZAyaD8S3ido",
}

Here, in the msg field we can see value of flattened.$.[0]. But we don't see the whole flattened, even though it might be very relevant for debugging the cause of error.

It would be great to be able to retrieve all the data used by failed instruction, and present it along the error. Like:

the following variables were used

flattened: [[{ peer_id: ..., relay_id: ... ]]

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-dxcategory: developer experience improvements

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions