mirror of
https://github.com/trezor/trezor-wallet
synced 2024-11-27 10:48:22 +00:00
log errors
This commit is contained in:
parent
89fa7d3177
commit
21d0c3e50f
@ -175,6 +175,7 @@ const begin = (device: TrezorDevice, networkName: string): AsyncAction => async
|
||||
throw new Error(`DiscoveryActions.begin: Unknown network type: ${network.type}`);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
dispatch({
|
||||
type: NOTIFICATION.ADD,
|
||||
payload: {
|
||||
@ -258,6 +259,7 @@ const discoverAccount = (device: TrezorDevice, discoveryProcess: Discovery): Asy
|
||||
return;
|
||||
}
|
||||
|
||||
console.error(error);
|
||||
dispatch({
|
||||
type: DISCOVERY.STOP,
|
||||
device,
|
||||
|
@ -205,6 +205,7 @@ const loadJSON = (): AsyncAction => async (dispatch: Dispatch): Promise<void> =>
|
||||
ERC20Abi,
|
||||
});
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
dispatch({
|
||||
type: STORAGE.ERROR,
|
||||
error,
|
||||
|
@ -178,6 +178,7 @@ export const init = (): AsyncAction => async (
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
dispatch({
|
||||
type: CONNECT.INITIALIZATION_ERROR,
|
||||
error,
|
||||
|
@ -116,6 +116,7 @@ export const initWeb3 = (
|
||||
const otherWeb3 = await dispatch(initWeb3(network, urlIndex + 1));
|
||||
resolve(otherWeb3);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
reject(error);
|
||||
}
|
||||
}
|
||||
|
@ -61,6 +61,7 @@ export const getGasPrice = (
|
||||
const gasPrice = await dispatch(Web3Actions.getCurrentGasPrice(network));
|
||||
return gasPrice === '0' ? new BigNumber(defaultGasPrice) : new BigNumber(gasPrice);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
return new BigNumber(defaultGasPrice);
|
||||
}
|
||||
};
|
||||
|
@ -819,6 +819,7 @@ export const onSend = (): AsyncAction => async (
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
dispatch({
|
||||
type: NOTIFICATION.ADD,
|
||||
payload: {
|
||||
|
@ -408,6 +408,7 @@ export const calculateFee = (gasPrice: string, gasLimit: string): string => {
|
||||
'ether'
|
||||
);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
return '0';
|
||||
}
|
||||
};
|
||||
@ -421,6 +422,7 @@ export const calculateTotal = (amount: string, gasPrice: string, gasLimit: strin
|
||||
}
|
||||
return bAmount.plus(calculateFee(gasPrice, gasLimit)).toFixed();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
return '0';
|
||||
}
|
||||
};
|
||||
@ -437,6 +439,7 @@ export const calculateMaxAmount = (
|
||||
if (max.isLessThan(0)) return '0';
|
||||
return max.toFixed();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
return '0';
|
||||
}
|
||||
};
|
||||
|
@ -383,6 +383,7 @@ const calculateTotal = (amount: string, fee: string): string => {
|
||||
}
|
||||
return bAmount.plus(fee).toFixed();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
return '0';
|
||||
}
|
||||
};
|
||||
@ -394,6 +395,7 @@ const calculateMaxAmount = (balance: BigNumber, fee: string): string => {
|
||||
if (max.isLessThan(0)) return '0';
|
||||
return max.toFixed();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
return '0';
|
||||
}
|
||||
};
|
||||
|
@ -62,6 +62,7 @@ const loadRateAction = (): AsyncAction => async (
|
||||
});
|
||||
} catch (error) {
|
||||
// ignore error
|
||||
console.error(error);
|
||||
}
|
||||
|
||||
await resolveAfter(50000);
|
||||
|
@ -11,6 +11,7 @@ export const toDecimalAmount = (amount: string | number, decimals: number): stri
|
||||
}
|
||||
return bAmount.div(10 ** decimals).toString(10);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
return '0';
|
||||
}
|
||||
};
|
||||
@ -24,6 +25,7 @@ export const fromDecimalAmount = (amount: string | number, decimals: number): st
|
||||
}
|
||||
return bAmount.times(10 ** decimals).toString(10);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
return '0';
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user