Merge pull request #554 from trezor/feature/log-errors

log errors
pull/569/head
Vladimir Volek 5 years ago committed by GitHub
commit 3f155be432
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -175,6 +175,7 @@ const begin = (device: TrezorDevice, networkName: string): AsyncAction => async
throw new Error(`DiscoveryActions.begin: Unknown network type: ${network.type}`); throw new Error(`DiscoveryActions.begin: Unknown network type: ${network.type}`);
} }
} catch (error) { } catch (error) {
console.error(error);
dispatch({ dispatch({
type: NOTIFICATION.ADD, type: NOTIFICATION.ADD,
payload: { payload: {
@ -258,6 +259,7 @@ const discoverAccount = (device: TrezorDevice, discoveryProcess: Discovery): Asy
return; return;
} }
console.error(error);
dispatch({ dispatch({
type: DISCOVERY.STOP, type: DISCOVERY.STOP,
device, device,

@ -205,6 +205,7 @@ const loadJSON = (): AsyncAction => async (dispatch: Dispatch): Promise<void> =>
ERC20Abi, ERC20Abi,
}); });
} catch (error) { } catch (error) {
console.error(error);
dispatch({ dispatch({
type: STORAGE.ERROR, type: STORAGE.ERROR,
error, error,

@ -178,6 +178,7 @@ export const init = (): AsyncAction => async (
}, },
}); });
} catch (error) { } catch (error) {
console.error(error);
dispatch({ dispatch({
type: CONNECT.INITIALIZATION_ERROR, type: CONNECT.INITIALIZATION_ERROR,
error, error,

@ -116,6 +116,7 @@ export const initWeb3 = (
const otherWeb3 = await dispatch(initWeb3(network, urlIndex + 1)); const otherWeb3 = await dispatch(initWeb3(network, urlIndex + 1));
resolve(otherWeb3); resolve(otherWeb3);
} catch (error) { } catch (error) {
console.error(error);
reject(error); reject(error);
} }
} }

@ -61,6 +61,7 @@ export const getGasPrice = (
const gasPrice = await dispatch(Web3Actions.getCurrentGasPrice(network)); const gasPrice = await dispatch(Web3Actions.getCurrentGasPrice(network));
return gasPrice === '0' ? new BigNumber(defaultGasPrice) : new BigNumber(gasPrice); return gasPrice === '0' ? new BigNumber(defaultGasPrice) : new BigNumber(gasPrice);
} catch (error) { } catch (error) {
console.error(error);
return new BigNumber(defaultGasPrice); return new BigNumber(defaultGasPrice);
} }
}; };

@ -819,6 +819,7 @@ export const onSend = (): AsyncAction => async (
}, },
}); });
} catch (error) { } catch (error) {
console.error(error);
dispatch({ dispatch({
type: NOTIFICATION.ADD, type: NOTIFICATION.ADD,
payload: { payload: {

@ -408,6 +408,7 @@ export const calculateFee = (gasPrice: string, gasLimit: string): string => {
'ether' 'ether'
); );
} catch (error) { } catch (error) {
console.error(error);
return '0'; return '0';
} }
}; };
@ -421,6 +422,7 @@ export const calculateTotal = (amount: string, gasPrice: string, gasLimit: strin
} }
return bAmount.plus(calculateFee(gasPrice, gasLimit)).toFixed(); return bAmount.plus(calculateFee(gasPrice, gasLimit)).toFixed();
} catch (error) { } catch (error) {
console.error(error);
return '0'; return '0';
} }
}; };
@ -437,6 +439,7 @@ export const calculateMaxAmount = (
if (max.isLessThan(0)) return '0'; if (max.isLessThan(0)) return '0';
return max.toFixed(); return max.toFixed();
} catch (error) { } catch (error) {
console.error(error);
return '0'; return '0';
} }
}; };

@ -383,6 +383,7 @@ const calculateTotal = (amount: string, fee: string): string => {
} }
return bAmount.plus(fee).toFixed(); return bAmount.plus(fee).toFixed();
} catch (error) { } catch (error) {
console.error(error);
return '0'; return '0';
} }
}; };
@ -394,6 +395,7 @@ const calculateMaxAmount = (balance: BigNumber, fee: string): string => {
if (max.isLessThan(0)) return '0'; if (max.isLessThan(0)) return '0';
return max.toFixed(); return max.toFixed();
} catch (error) { } catch (error) {
console.error(error);
return '0'; return '0';
} }
}; };

@ -62,6 +62,7 @@ const loadRateAction = (): AsyncAction => async (
}); });
} catch (error) { } catch (error) {
// ignore error // ignore error
console.error(error);
} }
await resolveAfter(50000); await resolveAfter(50000);

@ -11,6 +11,7 @@ export const toDecimalAmount = (amount: string | number, decimals: number): stri
} }
return bAmount.div(10 ** decimals).toString(10); return bAmount.div(10 ** decimals).toString(10);
} catch (error) { } catch (error) {
console.error(error);
return '0'; return '0';
} }
}; };
@ -24,6 +25,7 @@ export const fromDecimalAmount = (amount: string | number, decimals: number): st
} }
return bAmount.times(10 ** decimals).toString(10); return bAmount.times(10 ** decimals).toString(10);
} catch (error) { } catch (error) {
console.error(error);
return '0'; return '0';
} }
}; };

Loading…
Cancel
Save