Refactor error messages
This commit is contained in:
parent
5523383781
commit
85177d3ddd
|
@ -82,8 +82,7 @@ export const generateTxGasEstimateFrom = async (
|
||||||
// Add 10k else we will fail in case of nested calls
|
// Add 10k else we will fail in case of nested calls
|
||||||
return txGasEstimate.toNumber() + 10000
|
return txGasEstimate.toNumber() + 10000
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// eslint-disable-next-line
|
console.error('Error calculating tx gas estimation', error)
|
||||||
console.log('Error calculating tx gas estimation ' + error)
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -128,8 +127,7 @@ export const calculateTxFee = async (
|
||||||
|
|
||||||
return estimate
|
return estimate
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// eslint-disable-next-line
|
console.error('Error calculating tx gas estimation', error)
|
||||||
console.log('Error calculating tx gas estimation ' + error)
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,8 +22,7 @@ export const saveSafes = async (safes: Object) => {
|
||||||
try {
|
try {
|
||||||
await saveToStorage(SAFES_KEY, safes)
|
await saveToStorage(SAFES_KEY, safes)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// eslint-disable-next-line
|
console.error('Error storing safe info in localstorage', err)
|
||||||
console.log('Error storing safe info in localstorage')
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,8 +31,7 @@ export const setOwners = async (safeAddress: string, owners: List<Owner>) => {
|
||||||
const ownersAsMap = Map(owners.map((owner: Owner) => [owner.address.toLowerCase(), owner.name]))
|
const ownersAsMap = Map(owners.map((owner: Owner) => [owner.address.toLowerCase(), owner.name]))
|
||||||
await saveToStorage(`${OWNERS_KEY}-${safeAddress}`, ownersAsMap)
|
await saveToStorage(`${OWNERS_KEY}-${safeAddress}`, ownersAsMap)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// eslint-disable-next-line
|
console.error('Error storing owners in localstorage', err)
|
||||||
console.log('Error storing owners in localstorage')
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,8 +40,7 @@ export const fetchTokens = () => async (dispatch: ReduxDispatch<GlobalState>) =>
|
||||||
|
|
||||||
dispatch(saveTokens(tokens))
|
dispatch(saveTokens(tokens))
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// eslint-disable-next-line
|
console.error('Error fetching token list', err)
|
||||||
console.log('Error fetching token list ' + err)
|
|
||||||
|
|
||||||
return Promise.resolve()
|
return Promise.resolve()
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,8 +14,7 @@ export const saveActiveTokens = async (tokens: Map<string, Token>) => {
|
||||||
try {
|
try {
|
||||||
await saveToStorage(ACTIVE_TOKENS_KEY, tokens.toJS())
|
await saveToStorage(ACTIVE_TOKENS_KEY, tokens.toJS())
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// eslint-disable-next-line
|
console.error('Error storing tokens in localstorage', err)
|
||||||
console.log('Error storing tokens in localstorage')
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,8 +37,7 @@ export const removeTokenFromStorage = async (safeAddress: string, token: Token)
|
||||||
const index = data.indexOf(token)
|
const index = data.indexOf(token)
|
||||||
await saveToStorage(CUSTOM_TOKENS_KEY, data.remove(index))
|
await saveToStorage(CUSTOM_TOKENS_KEY, data.remove(index))
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// eslint-disable-next-line
|
console.error('Error removing token in localstorage', err)
|
||||||
console.log('Error removing token in localstorage')
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,8 +50,7 @@ class Load extends React.Component<Props> {
|
||||||
const url = `${SAFELIST_ADDRESS}/${safeAddress}`
|
const url = `${SAFELIST_ADDRESS}/${safeAddress}`
|
||||||
history.push(url)
|
history.push(url)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// eslint-disable-next-line
|
console.error('Error while loading the Safe', error)
|
||||||
console.log('Error while loading the Safe' + error)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -117,8 +117,7 @@ const AddOwner = ({
|
||||||
try {
|
try {
|
||||||
sendAddOwner(values, safeAddress, owners, enqueueSnackbar, closeSnackbar, createTransaction, addSafeOwner)
|
sendAddOwner(values, safeAddress, owners, enqueueSnackbar, closeSnackbar, createTransaction, addSafeOwner)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// eslint-disable-next-line
|
console.error('Error while removing an owner', error)
|
||||||
console.log('Error while removing an owner ' + error)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -123,8 +123,7 @@ const ReplaceOwner = ({
|
||||||
replaceSafeOwner,
|
replaceSafeOwner,
|
||||||
)
|
)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// eslint-disable-next-line
|
console.error('Error while removing an owner', error)
|
||||||
console.log('Error while removing an owner ' + error)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,8 +15,7 @@ export const storeSignature = async (safeAddress: string, nonce: number, signatu
|
||||||
const updatedSubjects = subjects.set(key, signatures)
|
const updatedSubjects = subjects.set(key, signatures)
|
||||||
await saveToStorage(signaturesKey, updatedSubjects)
|
await saveToStorage(signaturesKey, updatedSubjects)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// eslint-disable-next-line
|
console.error('Error storing signatures in localstorage', err)
|
||||||
console.log('Error storing signatures in localstorage')
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,8 +12,7 @@ export const storeSubject = async (safeAddress: string, nonce: number, subject:
|
||||||
const updatedSubjects = subjects.set(nonce, subject)
|
const updatedSubjects = subjects.set(nonce, subject)
|
||||||
saveToStorage(key, updatedSubjects)
|
saveToStorage(key, updatedSubjects)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// eslint-disable-next-line
|
console.error('Error storing transaction subject in localstorage', err)
|
||||||
console.log('Error storing transaction subject in localstorage')
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue