Skip to content

Commit 483d0cd

Browse files
committed
fix: Use error constant
1 parent c1e534c commit 483d0cd

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

packages/seedless-onboarding-controller/src/SeedlessOnboardingController.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1731,7 +1731,7 @@ describe('SeedlessOnboardingController', () => {
17311731
},
17321732
),
17331733
).rejects.toThrow(
1734-
'PrimarySrp cannot be added via addNewSecretData. Use createToprfKeyAndBackupSeedPhrase instead.',
1734+
SeedlessOnboardingControllerErrorMessage.PrimarySrpCannotBeAddedViaAddNewSecretData,
17351735
);
17361736
});
17371737
});

packages/seedless-onboarding-controller/src/SeedlessOnboardingController.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ export class SeedlessOnboardingController<
534534
): Promise<void> {
535535
if (dataType === EncAccountDataType.PrimarySrp) {
536536
throw new Error(
537-
'PrimarySrp cannot be added via addNewSecretData. Use createToprfKeyAndBackupSeedPhrase instead.',
537+
SeedlessOnboardingControllerErrorMessage.PrimarySrpCannotBeAddedViaAddNewSecretData,
538538
);
539539
}
540540

packages/seedless-onboarding-controller/src/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,5 @@ export enum SeedlessOnboardingControllerErrorMessage {
6060
FailedToFetchAuthPubKey = `${controllerName} - Failed to fetch latest auth pub key`,
6161
InvalidPasswordOutdatedCache = `${controllerName} - Invalid password outdated cache provided.`,
6262
FailedToRefreshJWTTokens = `${controllerName} - Failed to refresh JWT tokens`,
63+
PrimarySrpCannotBeAddedViaAddNewSecretData = `${controllerName} - PrimarySrp cannot be added via addNewSecretData. Use createToprfKeyAndBackupSeedPhrase instead.`,
6364
}

0 commit comments

Comments
 (0)