chore: explicitly share error message used for logic

This commit is contained in:
2025-09-01 06:42:00 -06:00
parent 1499211018
commit fa8956fb38
2 changed files with 5 additions and 2 deletions

View File

@@ -614,6 +614,8 @@ export const retrieveAllAccountsMetadata = async (): Promise<
return result;
};
export const DUPLICATE_ACCOUNT_ERROR = "Cannot import duplicate account.";
/**
* Saves a new identity to both SQL and Dexie databases
*/
@@ -634,7 +636,7 @@ export async function saveNewIdentity(
if (existingAccount?.values?.length) {
throw new Error(
`Account with DID ${identity.did} already exists. Cannot import duplicate account.`,
`Account with DID ${identity.did} already exists. ${DUPLICATE_ACCOUNT_ERROR}`,
);
}