Browse Source

chore: remove error logging for errors that are propagated

pull/189/head
Trent Larson 6 days ago
parent
commit
2c7cb9333e
  1. 20
      src/libs/util.ts

20
src/libs/util.ts

@ -617,14 +617,13 @@ export const retrieveAllAccountsMetadata = async (): Promise<
export const DUPLICATE_ACCOUNT_ERROR = "Cannot import duplicate account."; export const DUPLICATE_ACCOUNT_ERROR = "Cannot import duplicate account.";
/** /**
* Saves a new identity to both SQL and Dexie databases * Saves a new identity to SQL database
*/ */
export async function saveNewIdentity( export async function saveNewIdentity(
identity: IIdentifier, identity: IIdentifier,
mnemonic: string, mnemonic: string,
derivationPath: string, derivationPath: string,
): Promise<void> { ): Promise<void> {
try {
// add to the new sql db // add to the new sql db
const platformService = await getPlatformService(); const platformService = await getPlatformService();
@ -673,10 +672,6 @@ export async function saveNewIdentity(
await platformService.updateDefaultSettings({ activeDid: identity.did }); await platformService.updateDefaultSettings({ activeDid: identity.did });
await platformService.insertNewDidIntoSettings(identity.did); await platformService.insertNewDidIntoSettings(identity.did);
} catch (error) {
logger.error("Failed to save new identity:", error);
throw error;
}
} }
/** /**
@ -1074,7 +1069,6 @@ export async function checkForDuplicateAccount(
didOrMnemonic: string, didOrMnemonic: string,
derivationPath?: string, derivationPath?: string,
): Promise<boolean> { ): Promise<boolean> {
try {
let didToCheck: string; let didToCheck: string;
if (derivationPath) { if (derivationPath) {
@ -1084,12 +1078,7 @@ export async function checkForDuplicateAccount(
derivationPath, derivationPath,
); );
const newId = newIdentifier( const newId = newIdentifier(address, privateHex, publicHex, derivationPath);
address,
privateHex,
publicHex,
derivationPath,
);
didToCheck = newId.did; didToCheck = newId.did;
} else { } else {
// Use the provided DID directly // Use the provided DID directly
@ -1104,9 +1093,4 @@ export async function checkForDuplicateAccount(
); );
return (existingAccount?.values?.length ?? 0) > 0; return (existingAccount?.values?.length ?? 0) > 0;
} catch (error) {
// If we can't check for duplicates, let the calling process handle the error
logger.error("Error checking for duplicate account:", error);
throw error;
}
} }

Loading…
Cancel
Save