Skip to content

Commit 782e6bb

Browse files
committed
fix: don't export KeyringControllerErrorMessage from the keyring
controller
1 parent 0509156 commit 782e6bb

3 files changed

Lines changed: 2 additions & 7 deletions

File tree

packages/keyring-controller/CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- Add `KeyringTypes.money` (`'Money Keyring'`) to the `KeyringTypes` enum ([#8204](https://github.com/MetaMask/core/pull/8204))
1313
- Add `MoneyKeyring` (from `@metamask/eth-money-keyring`) as a built-in default keyring ([#8204](https://github.com/MetaMask/core/pull/8204))
14-
- Export `KeyringControllerErrorMessage` enum to allow consumers to distinguish specific controller error cases ([#8204](https://github.com/MetaMask/core/pull/8204))
1514

1615
### Changed
1716

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
export * from './KeyringController';
22
export type * from './types';
33
export * from './errors';
4-
export { KeyringControllerErrorMessage } from './constants';

packages/money-account-service/src/MoneyAccountService.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { HdKeyring } from '@metamask/eth-hd-keyring';
22
import { MONEY_DERIVATION_PATH } from '@metamask/eth-money-keyring';
33
import {
44
KeyringControllerError,
5-
KeyringControllerErrorMessage,
65
KeyringTypes,
76
} from '@metamask/keyring-controller';
87
import type { KeyringMetadata } from '@metamask/keyring-controller';
@@ -91,10 +90,8 @@ export class MoneyAccountService {
9190
async ({ metadata }) => metadata,
9291
)
9392
.catch((error: unknown) => {
94-
if (
95-
error instanceof KeyringControllerError &&
96-
error.message === KeyringControllerErrorMessage.KeyringNotFound
97-
) {
93+
if (error instanceof KeyringControllerError) {
94+
// TODO: how should we determine whether this is a 'real' error, or something we potentially expect, like not finding a keyring?
9895
return null;
9996
}
10097
throw error;

0 commit comments

Comments
 (0)