fix(multichain-account-service): do not report TimeoutError + static error messages#8249
fix(multichain-account-service): do not report TimeoutError + static error messages#8249
TimeoutError + static error messages#8249Conversation
packages/multichain-account-service/src/MultichainAccountService.ts
Outdated
Show resolved
Hide resolved
packages/multichain-account-service/src/MultichainAccountWallet.ts
Outdated
Show resolved
Hide resolved
packages/multichain-account-service/src/MultichainAccountService.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
packages/multichain-account-service/src/MultichainAccountWallet.ts
Outdated
Show resolved
Hide resolved
| ); | ||
| this.#messenger.captureException?.(sentryError); | ||
|
|
||
| const errorMessage = `Unable to discover accounts with provider "${providerName}"`; |
There was a problem hiding this comment.
Changed this message to unify with other messages we were reporting to Sentry. The providerName won't change a lot, so this won't mess up Sentry message grouping too much (it might just group those under the right provider, which is good IMO)
| }, | ||
| ); | ||
| this.messenger.captureException?.(sentryError); | ||
| const errorMessage = 'Unable to re-sync accounts'; |
There was a problem hiding this comment.
Changed this to a more static message to avoid having different grouping for this message on Sentry. (the groupIndex was initially part of the message, thus the message was a bit "too dynamic").
We still have the groupIndex as part of the Sentry context, see below.
TimeoutErrorTimeoutError + static error messages

Explanation
The
TimeoutErrorwill naturally happen for some users, in case of network latency for example.We have those mechanism in place to not make the service hang forever if anything goes wrong with a provider operation. The best thing we can do is to adjust them to a reasonable threshold value depending on the platform we are.
That being said, having some feedback on such errors could be useful, which is why we keep logging them. We only report other kind of errors to Sentry too!
Also changed some error messages to use a more "static pattern" for some errors and avoid having different "grouping" on Sentry for those messages (e.g when the error message was too "dynamic")
References
Checklist
Note
Low Risk
Low risk: changes are limited to error reporting/logging behavior and timeout messaging, with broad test coverage added to lock in the new Sentry/console expectations.
Overview
Stops reporting
TimeoutErrors to Sentry across provider operations (account creation, discovery, and resync), treating them as warnings while continuing to capture non-timeout errors.Introduces a shared
reportErrorhelper (pluslogErrorAsandisTimeoutError) to standardize static error messages/context for better Sentry grouping, and updateswithTimeoutto include the timeout duration in the thrown error message. Tests are extended to assert the new capture/console behavior inMultichainAccountService,MultichainAccountWallet, andSnapAccountProvider, and the changelog is updated accordingly.Written by Cursor Bugbot for commit 663d9b7. This will update automatically on new commits. Configure here.