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

Unhelpful and unorganized error messages #1556

Closed
8 of 9 tasks
arboleya opened this issue Dec 19, 2023 · 2 comments · Fixed by #2000
Closed
8 of 9 tasks

Unhelpful and unorganized error messages #1556

arboleya opened this issue Dec 19, 2023 · 2 comments · Fixed by #2000
Assignees
Labels
docs Requests pertinent to documentation

Comments

@arboleya
Copy link
Member

arboleya commented Dec 19, 2023

Origin story

We should organize all error messages and properly document them, so there is a consistent, helpful and descriptive set of error messages across the sdk instead of ones I experienced like "too small" with no value or details flagged.

Requirements

Redundant error codes

PR: #2002

  • FRAGMENT_NOT_FOUND due to the getFunction throwing a FUNCTION_NOT_FOUND
  • INSUFFICIENT_BALANCE - no found in code anywhere apart from docs
  • INVALID_URL - not used anywhere other than doc examples and tests
  • LATEST_BLOCK_UNAVAILABLE - unused
  • UNEXPECTED_HEX_VALUE - used in hexlifyWithPrefix, which could be simplified (see below). knownHex flag seems redudant only ever true, with these only two instances.
export const hexlifyWithPrefix = (value: string) => value.startsWith('0x') ? hexlify(value) : hexlify(`0x${value}`)

Discussion worthy

  • Decoding and encoding error handling has room for improvement, would be good to get peoples thoughts on handling these errors.
  • Consolidate INVALID_PASSWORD and INVALID_CREDENTIALS
  • MemoryCache doesn't allow a value of 0 for the TTL and will throw INVALID_TTL.
    I believe 0 should be allowed, as this implies the cache should be skipped.
  • We have two means of retrieving error codes for an error ErrorCode. and FuelError.CODES., I believe it should be one or the other, what do other people think?

Related

@arboleya arboleya added docs Requests pertinent to documentation chore Issue is a chore labels Dec 19, 2023
@arboleya arboleya added this to the 3 - Wasp milestone Jan 8, 2024
@arboleya arboleya removed the chore Issue is a chore label Jan 31, 2024
@arboleya arboleya modified the milestones: 3 - Wasp, 4 - Cricket Jan 31, 2024
@petertonysmith94
Copy link
Contributor

@danielbate please tag me please

@petertonysmith94
Copy link
Contributor

petertonysmith94 commented Feb 22, 2024

Moved this comment to the issue body 😃

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

Successfully merging a pull request may close this issue.

2 participants