Quick error logging (will clean this up later)

This commit is contained in:
Gilbert 2024-05-01 18:23:51 -05:00
parent d7dc9a07f9
commit f7d6d02b27
2 changed files with 6 additions and 0 deletions

View File

@ -18,6 +18,7 @@ import { Link } from 'react-router-dom';
import { PKPEthersWallet } from '@lit-protocol/pkp-ethers'; import { PKPEthersWallet } from '@lit-protocol/pkp-ethers';
import { signInWithEthereum } from 'utils/siwe'; import { signInWithEthereum } from 'utils/siwe';
import { useSnowball } from 'utils/use-snowball'; import { useSnowball } from 'utils/use-snowball';
import { logError } from 'utils/log-error';
type Provider = 'google' | 'github' | 'apple' | 'email' | 'passkey'; type Provider = 'google' | 'github' | 'apple' | 'email' | 'passkey';
@ -52,12 +53,14 @@ export const Login = ({ onDone }: Props) => {
setError(result.error); setError(result.error);
setProvider(false); setProvider(false);
wallet = undefined; wallet = undefined;
logError(new Error(result.error));
return; return;
} }
} catch (err: any) { } catch (err: any) {
setError(err.message); setError(err.message);
console.log(err.message, err.name, err.details); console.log(err.message, err.name, err.details);
setProvider(false); setProvider(false);
logError(err);
return; return;
} }
} }

View File

@ -16,6 +16,7 @@ import { Link } from 'react-router-dom';
import { useToast } from 'components/shared/Toast'; import { useToast } from 'components/shared/Toast';
import { PKPEthersWallet } from '@lit-protocol/pkp-ethers'; import { PKPEthersWallet } from '@lit-protocol/pkp-ethers';
import { signInWithEthereum } from 'utils/siwe'; import { signInWithEthereum } from 'utils/siwe';
import { logError } from 'utils/log-error';
type Provider = 'google' | 'github' | 'apple' | 'email'; type Provider = 'google' | 'github' | 'apple' | 'email';
@ -46,11 +47,13 @@ export const SignUp = ({ onDone }: Props) => {
setError({ type: 'provider', message: result.error }); setError({ type: 'provider', message: result.error });
setProvider(false); setProvider(false);
wallet = undefined; wallet = undefined;
logError(new Error(result.error));
return; return;
} }
} catch (err: any) { } catch (err: any) {
setError({ type: 'provider', message: err.message }); setError({ type: 'provider', message: err.message });
setProvider(false); setProvider(false);
logError(err);
return; return;
} }
} }