skip logging more expected errors

This commit is contained in:
Aleka Cheung 2024-02-12 12:44:45 -05:00
parent 949a1bfd6c
commit 8818d64c3e
No known key found for this signature in database
GPG Key ID: 53E472E5EF4F4102
2 changed files with 17 additions and 9 deletions

View File

@ -163,17 +163,20 @@ export const useWalletConnection = () => {
}
}
} catch (error) {
throw Object.assign(
new Error([error.message, error.cause?.message].filter(Boolean).join('\n')),
{
walletConnectionType: walletConnection?.type,
}
);
const { isErrorExpected } = parseWalletError({ error, stringGetter });
if (!isErrorExpected) {
throw Object.assign(
new Error([error.message, error.cause?.message].filter(Boolean).join('\n')),
{
walletConnectionType: walletConnection?.type,
}
);
}
}
return {
walletType,
walletConnectionType: walletConnection.type,
walletConnectionType: walletConnection?.type,
};
},
[isConnectedGraz, signerGraz, isConnectedWagmi, signerWagmi]

View File

@ -166,11 +166,16 @@ export const GenerateKeys = ({
setStatus(EvmDerivedAccountStatus.Derived);
} catch (error) {
setStatus(EvmDerivedAccountStatus.NotDerived);
const { message, walletErrorType } = parseWalletError({ error, stringGetter });
const { message, walletErrorType, isErrorExpected } = parseWalletError({
error,
stringGetter,
});
if (message) {
setError(message);
log('GenerateKeys/deriveKeys', error, { walletErrorType });
if (!isErrorExpected) {
log('GenerateKeys/deriveKeys', error, { walletErrorType });
}
}
}
};