Skip to content

Improve error messages#1134

Closed
csillag wants to merge 1 commit intomasterfrom
csillag/better-error-messages
Closed

Improve error messages#1134
csillag wants to merge 1 commit intomasterfrom
csillag/better-error-messages

Conversation

@csillag
Copy link
Copy Markdown
Contributor

@csillag csillag commented Jan 5, 2024

Always try to properly differentiate between:

  • Illegal request (wrong address etc)
  • Failure to load data
  • Data not found
Situation Before After
Can't load block details block_before_cant_load block_after_cant_load
Can't load TX details tx_before_cant_load tx_after_cant_load
Can't load Token data token_before_cant_load token_after_cant_load
Token does not exist token_before_not_found token_after_not_found

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 5, 2024

Deployed to Cloudflare Pages

Latest commit: fe7fce9a4b0c37cb0769a966cc044d0009f52bfb
Status:✅ Deploy successful!
Preview URL: https://46807111.oasis-explorer.pages.dev

@csillag csillag force-pushed the csillag/better-error-messages branch from 92d764e to cca9d7d Compare January 5, 2024 14:54
@csillag csillag marked this pull request as ready for review January 5, 2024 14:55
@csillag csillag force-pushed the csillag/better-error-messages branch from cca9d7d to 2504455 Compare January 5, 2024 17:07
},
"errors": {
"canNotLoadData": "Can not load data",
"canNotReachDataSource": "We were unable to reach the data source to request this data. This is probably a temporary (network?) problem. Please try again later.",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"(network?)"

should we avoid the word "network" and use connection/connectivity?

cc @donouwens

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Friendly reminder: this is waiting for input from @donouwens

Comment thread src/oasis-nexus/api.ts
data: 'not found',
headers: {},
})
return undefined
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +43 to +44
// TODO: look for other error codes, too.
// (Currently we are not aware of anything else)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Others: https://github.com/axios/axios/blob/6d4c421/README.md#error-types

ETIMEDOUT, ECONNABORTED, ERR_BAD_RESPONSE would indicate backend issue

Always try to properly differentiate between:
 - Illegal request (wrong address etc)
 - Failure to load data
 - Data not found
@csillag csillag force-pushed the csillag/better-error-messages branch from 2504455 to fe7fce9 Compare January 27, 2024 13:29
@buberdds buberdds closed this Jan 30, 2026
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 this pull request may close these issues.

3 participants