Skip to content

Conversation

@csillag
Copy link
Contributor

@csillag csillag commented Aug 28, 2025

Any time we display an address, we want to check out if it has a token name. However, if no such token exists, we get a 404 error, and hence, a big ugly exception on the console, for each lookup attepmts. It looks like this:

image

This change makes it so that these errors are swallowed. (Not all token lookup errors, just the opportunistic ones, for finding out if they have a name.)

After this change, even in development mode, all we see on the console, after 5 look up attempts, is this:

image

@github-actions
Copy link

github-actions bot commented Aug 28, 2025

Deployed to Cloudflare Pages

Latest commit: 8e088cc22efd1e83a6039a28690a1769d5daaecd
Status:✅ Deploy successful!
Preview URL: https://9ace6e5e.oasis-explorer.pages.dev
Alias: https://pr-2163.oasis-explorer.pages.dev

@csillag csillag force-pushed the csillag/suppress-useless-errors branch from ea69204 to be5668e Compare August 28, 2025 13:51
@csillag csillag marked this pull request as ready for review August 28, 2025 13:55
The custom logger will look for a specific flag on the request config,
called "swallowError", and if it is set, swallow the error.
Any time we display an address, we want to check out if it has
a token name. However, if it does not, we get a 404 error, and hence,
a big ugly exception on the console. This change flags this request
so that any error will be swallowed.
@csillag csillag force-pushed the csillag/suppress-useless-errors branch from be5668e to 8e088cc Compare August 28, 2025 14:31
@csillag csillag self-assigned this Aug 28, 2025
@buberdds
Copy link
Contributor

buberdds commented Sep 10, 2025

Claiming that app throws useless errors and we should swallow them is imo wrong direction. There is a bug. Bug is in useAccountMetadata. It does not correctly check whether we deal with contract or not and sets enabled incorrectly when calling useTokenInfo hook.

@lukaw3d
Copy link
Member

lukaw3d commented Oct 8, 2025

Maybe just be a bit stricter: if 404: swallow.

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.

4 participants