-
Notifications
You must be signed in to change notification settings - Fork 5
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
Improvement: Ensure contract returns meaningful errors #68
Comments
Digging around a bit I found that this might be a reason why our existing error messages are not being returned to the frontend. The details tag (
|
Pandelissym
added a commit
that referenced
this issue
Oct 24, 2023
- Removed the `X` tag from error messages in the contract. This ensures the error message is also returned to the makeOffer call. Now we can match on the error message and display an appropriate error to the user. closes #68 Co-authored-by: Pandelis Symeonidis <pandelis@kryha.io>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Contract errors thrown via
assert.fail(<error>);
cannot be inspected from the frontend using makeOffer error callbacks. The following code is responsible for catching errors on the client side (mint character in this case):Depending on where and how the error is thrown, we get 3 kinds of errors from
makeOffer
:mustMatch
. in this case we get an error in the format ofmint.ts:36 Offer error Error: offerArgs: (an object) - Must have missing properties ["name"] string
assert.fail(<error>);
resulting in the following errormint.ts:36 Offer error Error: (a string) string
Cases 1 and 2 work as intented and return meaningful errors, 3 does not.
Repro
Modify this line to use a name which has already been used, this should triggered scenario 3.
Acceptance Criteria
assert.fail(<error>)
can be used to get meaningful errors usingmakeOffer
or they have been replaced with something that canThe text was updated successfully, but these errors were encountered: