Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error formatting: Go over the displayed errors and make them more user friendly #40

Open
sr-gi opened this issue Aug 17, 2023 · 6 comments
Labels
Low Priority nit Small nitpicks that are picked up in testing.
Milestone

Comments

@sr-gi
Copy link
Member

sr-gi commented Aug 17, 2023

Just as an example, if a destination node does not support keysend, this is the error we'll be getting:

Error: Lightning Error: ValidationError("Destination node does not support keysend 02ab4734430c485b1d15af93ff00060db86f7fe952b04c19afd42709dcd83b1c50")

Caused by:
    Config validation failed Destination node does not support keysend 02ab4734430c485b1d15af93ff00060db86f7fe952b04c19afd42709dcd83b1c50
@sr-gi sr-gi added the nit Small nitpicks that are picked up in testing. label Aug 17, 2023
@carlaKC carlaKC added this to the V3 milestone Mar 27, 2024
@AdamuAbba
Copy link

Hey @carlaKC is it fine if I pick this up?

@AdamuAbba
Copy link

AdamuAbba commented Apr 18, 2024

hey @carlaKC regarding the error messages based on @sr-gi's example above would any of the formats below be acceptable? I'll implement whichever one you pick.

Error: Lightning Error
Caused by:
   Config validation failed Destination node does not support keysend 02ab4734430c485b1d15af93ff00060db86f7fe952b04c19afd42709dcd83b1c50

or do we go with just:

Caused by:
    Config validation failed Destination node does not support keysend 02ab4734430c485b1d15af93ff00060db86f7fe952b04c19afd42709dcd83b1c50

or maybe:

Error: Lightning Error
Type: Validation Error
Caused by: Config validation failed Destination node does not support keysend 02ab4734430c485b1d15af93ff00060db86f7fe952b04c19afd42709dcd83b1c50

we can also consider:

Error: Lightning Error
Type: Validation Error
Caused by: Config validation failed Destination node does not support keysend
Destination: 02ab4734430c485b1d15af93ff00060db86f7fe952b04c19afd42709dcd83b1c50

Standing by for your decision.

@carlaKC
Copy link
Contributor

carlaKC commented Apr 22, 2024

This one is fine to me, no strong opinions though:

Error: Lightning Error
Caused by:
   Config validation failed Destination node does not support keysend 02ab4734430c485b1d15af93ff00060db86f7fe952b04c19afd42709dcd83b1c50

@AdamuAbba
Copy link

Alright got it.

@carlaKC
Copy link
Contributor

carlaKC commented May 20, 2024

One place where we could do better on errors is when we parse our sim file - right now we just display a line an column, not the actual error.

Error: Could not deserialize node connection data or activity description from simulation file (line 41, col 5, err Cannot parse range. Ranges must be strictly increasing (i.e. [x, y] with x > y). Received [20000, 1000] at line 41 column 5).

Example: Missing comma in json

Error: Could not deserialize node connection data or activity description from simulation file (line 38, col 7).

When the actual error contains:

 err expected `,` or `}` at line 38 column 7

Example: Invalid Range

See discussion

Error: Could not deserialize node connection data or activity description from simulation file (line 41, col 5).

vs

Cannot parse range. Ranges must be strictly increasing (i.e. [x, y] with x > y). Received [20000, 1000] at line 41 column 5)

There is ofc a tradeoff between more information for debugging problems and angry-json-screaming, so I think we can look at classify for more nuanced handing of these cases.

@AdamuAbba
Copy link

Hey @carlaKC you're right. i'll look into classify and see how we can leverage on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Low Priority nit Small nitpicks that are picked up in testing.
Projects
None yet
Development

No branches or pull requests

3 participants