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

Review assertion error messages for clarity #723

Closed
jasongitmail opened this issue Feb 10, 2023 · 3 comments · Fixed by #902
Closed

Review assertion error messages for clarity #723

jasongitmail opened this issue Feb 10, 2023 · 3 comments · Fixed by #902

Comments

@jasongitmail
Copy link
Contributor

Problem:
It sounds like current assertion error messages are very unclear, enough that this should be prioritized. o1-labs/docs2#264 (comment)

Proposed Solution:
Let's have a few people review these for clarity.

Could someone add a link to the default assertion error messages please?

@mitschabaude
Copy link
Member

the errors for stuff like field.assertEquals(other) (without a custom message) get thrown from OCaml:
https://github.com/o1-labs/snarky/blob/ff2631f47bb644f7a31fd30be16ee0e5ff5279fa/src/base/checked.ml#L84

@mitschabaude
Copy link
Member

As soon as we implement the Field class in snarkyjs we can catch and throw with a different message

@mitschabaude
Copy link
Member

Another topic are the errors coming from transaction application (recent discussion: o1-labs/docs2#263). For those, we started a file where we can add handlers for each to add an explanatory message (and link!).
So far it contains only one handler:
https://github.com/o1-labs/snarkyjs/blob/e9779b80d6ad8f4019355c03d12d3c3334e4b2b6/src/lib/errors.ts#L7-L8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants