forked from trent_larson/crowd-funder-for-time-pwa
chore: explicitly share error message used for logic
This commit is contained in:
@@ -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}`,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user