You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(multichain-account-service)!: add error reporting around account creation (#7044)
## Explanation
Used the error reporting service to capture exceptions around account
creation.
## References
n/a
## Checklist
- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs),
highlighting breaking changes as necessary
- [x] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changes
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Integrates `ErrorReportingService` to capture exceptions during
multichain account creation, alignment, and discovery, adds a
`createSentryError` utility, updates messenger/types, and adjusts tests
and peer deps.
>
> - **multichain-account-service**:
> - **Error reporting integration**:
> - In `MultichainAccountWallet` and `MultichainAccountGroup`, wrap
provider failures in `createSentryError` and call
`ErrorReportingService:captureException` during `createAccounts` (EVM
and non‑EVM), `alignAccounts`, and `discoverAccounts`.
> - **Utilities**:
> - Add `utils#createSentryError` to attach `cause` and `context` to
errors.
> - **Messaging/Types**:
> - Extend `MultichainAccountServiceMessenger` allowed actions to
include `ErrorReportingService:captureException`; update test messenger
delegation.
> - **Tests**:
> - Update unit tests to register/mock
`ErrorReportingService:captureException` and assert calls on provider
failures.
> - **Changelog/Deps**:
> - Update `CHANGELOG.md` with BREAKING note; add
`@metamask/error-reporting-service` as a peer dependency (and
devDependency).
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
19411d9. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Copy file name to clipboardExpand all lines: packages/multichain-account-service/CHANGELOG.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
8
8
## [Unreleased]
9
9
10
+
### Added
11
+
12
+
-**BREAKING:** Added error reporting around account creation with the `ErrorReportingService` ([#7044](https://github.com/MetaMask/core/pull/7044))
13
+
- The `@metamask/error-reporting-service` is now a peer dependency.
14
+
10
15
### Changed
11
16
12
17
- Limit Bitcoin and Tron providers to 3 concurrent account creations by default when creating multichain account groups ([#7052](https://github.com/MetaMask/core/pull/7052))
`Failed to fully align multichain account group for entropy ID: ${wallet.entropySource} and group index: ${groupIndex}, some accounts might be missing`,
214
222
);
215
223
});
224
+
225
+
it('captures an error when a provider fails to create its account',async()=>{
226
+
constgroupIndex=0;
227
+
const{ group, providers, messenger }=setup({
228
+
groupIndex,
229
+
accounts: [[MOCK_WALLET_1_EVM_ACCOUNT],[]],
230
+
});
231
+
constproviderError=newError('Unable to create accounts');
`Unable to create account with provider "${provider.getName()}"`,
297
+
error,
298
+
{
299
+
groupIndex,
300
+
provider: provider.getName(),
301
+
},
302
+
);
303
+
this.#messenger.call(
304
+
'ErrorReportingService:captureException',
305
+
sentryError,
306
+
);
279
307
});
280
308
});
281
309
}
@@ -411,6 +439,18 @@ export class MultichainAccountWallet<
411
439
}catch(error){
412
440
consterrorMessage=`Unable to create multichain account group for index: ${groupIndex} with provider "${evmProvider.getName()}". Error: ${(errorasError).message}`;
0 commit comments