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 improvements per packages part2 #2505

Closed
5 tasks done
hui-an-yang opened this issue May 30, 2023 · 0 comments · Fixed by #2509 or #2520
Closed
5 tasks done

Error improvements per packages part2 #2505

hui-an-yang opened this issue May 30, 2023 · 0 comments · Fixed by #2509 or #2520
Assignees
Labels
ga_release Work to be done so we can remove the beta dsignation
Milestone

Comments

@hui-an-yang
Copy link
Collaborator

hui-an-yang commented May 30, 2023

Error improvement of packages below

  • taquito-http-utils
  • taquito-contracts-library
  • taquito-beacon-wallet
  • taquito-ledger-signer
  • taquito-remote-signer

Follow up of #160 as described in https://hackmd.io/@tca0T8LZT3au8LG6hSX20g/r1zTRTlfj_

Task 3 (should be split a least into one PR per package to ease the review): Go through all the errors in each package and:

  • Make the error extends one of these categories: Create high-level categories of errors #1992
  • Ensure that the error message is informative (what went wrong?) Use complete but simple sentences
  • When there is a problem with a value received as a parameter, the erroneous value should be part of the error message and an indication of what is wrong with it. For example: The key "inva2obfVMEuPUnadAConLWk7Tf4Dt3n4svSgJwrgpamRqJXvaYcg1" is invalid. It contains the invalid prefix "inva", but "p2sk" was expected. Surround the variable in the error message with quotes for clarity.
  • Make sure the variables are displayed properly in the error message to avoid error messages like: Failed to encode value '[object Object]'. Add tests to ensure proper rendering.
  • Ensure that the errors are actionable (tell the users what they can do to resolve the issue)
  • If an error overrides another error, make sure that it includes the "original error" as a param.
  • Document the error with a typedoc comment
  • Add an error code to each error with an additional explanation on a documentation page of the Taquito website. Add a link to the documentation in error.
  • Collect all error classes and put them inside a single-consistently named file in each package. E.g. an errors.ts file in the root of each package's /src folder. It will increase the ease of extending and maintaining error classes in the future.
  • When a method/function can throw an error, include the tag @throws in the typedoc comment with an explanation of when the error can be thrown.
  • Make sure there is a follow-up issues for the next set of packages:
    • based on effort involved, create an issue per package or cover multiple packages per issue

Here is an example of an error that needs improvement:

@hui-an-yang hui-an-yang added the ga_release Work to be done so we can remove the beta dsignation label May 30, 2023
@hui-an-yang hui-an-yang added this to the v17.x milestone May 30, 2023
@hui-an-yang hui-an-yang self-assigned this May 30, 2023
@hui-an-yang hui-an-yang modified the milestones: v17.x, v17 May 31, 2023
@hui-an-yang hui-an-yang reopened this Jun 9, 2023
@hui-an-yang hui-an-yang linked a pull request Jun 9, 2023 that will close this issue
9 tasks
@ac10n ac10n moved this to Done in Taquito Dev Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ga_release Work to be done so we can remove the beta dsignation
Projects
Status: Done
1 participant