Refactor error messages

This commit is contained in:
Germán Martínez 2019-09-27 12:35:13 +02:00
parent 5523383781
commit 85177d3ddd
9 changed files with 12 additions and 24 deletions

View File

@ -82,8 +82,7 @@ export const generateTxGasEstimateFrom = async (
// Add 10k else we will fail in case of nested calls
return txGasEstimate.toNumber() + 10000
} catch (error) {
// eslint-disable-next-line
console.log('Error calculating tx gas estimation ' + error)
console.error('Error calculating tx gas estimation', error)
return 0
}
}
@ -128,8 +127,7 @@ export const calculateTxFee = async (
return estimate
} catch (error) {
// eslint-disable-next-line
console.log('Error calculating tx gas estimation ' + error)
console.error('Error calculating tx gas estimation', error)
return 0
}
}

View File

@ -22,8 +22,7 @@ export const saveSafes = async (safes: Object) => {
try {
await saveToStorage(SAFES_KEY, safes)
} catch (err) {
// eslint-disable-next-line
console.log('Error storing safe info in localstorage')
console.error('Error storing safe info in localstorage', err)
}
}
@ -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]))
await saveToStorage(`${OWNERS_KEY}-${safeAddress}`, ownersAsMap)
} catch (err) {
// eslint-disable-next-line
console.log('Error storing owners in localstorage')
console.error('Error storing owners in localstorage', err)
}
}

View File

@ -40,8 +40,7 @@ export const fetchTokens = () => async (dispatch: ReduxDispatch<GlobalState>) =>
dispatch(saveTokens(tokens))
} catch (err) {
// eslint-disable-next-line
console.log('Error fetching token list ' + err)
console.error('Error fetching token list', err)
return Promise.resolve()
}

View File

@ -14,8 +14,7 @@ export const saveActiveTokens = async (tokens: Map<string, Token>) => {
try {
await saveToStorage(ACTIVE_TOKENS_KEY, tokens.toJS())
} catch (err) {
// eslint-disable-next-line
console.log('Error storing tokens in localstorage')
console.error('Error storing tokens in localstorage', err)
}
}
@ -38,8 +37,7 @@ export const removeTokenFromStorage = async (safeAddress: string, token: Token)
const index = data.indexOf(token)
await saveToStorage(CUSTOM_TOKENS_KEY, data.remove(index))
} catch (err) {
// eslint-disable-next-line
console.log('Error removing token in localstorage')
console.error('Error removing token in localstorage', err)
}
}

View File

@ -50,8 +50,7 @@ class Load extends React.Component<Props> {
const url = `${SAFELIST_ADDRESS}/${safeAddress}`
history.push(url)
} catch (error) {
// eslint-disable-next-line
console.log('Error while loading the Safe' + error)
console.error('Error while loading the Safe', error)
}
}

View File

@ -117,8 +117,7 @@ const AddOwner = ({
try {
sendAddOwner(values, safeAddress, owners, enqueueSnackbar, closeSnackbar, createTransaction, addSafeOwner)
} catch (error) {
// eslint-disable-next-line
console.log('Error while removing an owner ' + error)
console.error('Error while removing an owner', error)
}
}

View File

@ -123,8 +123,7 @@ const ReplaceOwner = ({
replaceSafeOwner,
)
} catch (error) {
// eslint-disable-next-line
console.log('Error while removing an owner ' + error)
console.error('Error while removing an owner', error)
}
}

View File

@ -15,8 +15,7 @@ export const storeSignature = async (safeAddress: string, nonce: number, signatu
const updatedSubjects = subjects.set(key, signatures)
await saveToStorage(signaturesKey, updatedSubjects)
} catch (err) {
// eslint-disable-next-line
console.log('Error storing signatures in localstorage')
console.error('Error storing signatures in localstorage', err)
}
}

View File

@ -12,8 +12,7 @@ export const storeSubject = async (safeAddress: string, nonce: number, subject:
const updatedSubjects = subjects.set(nonce, subject)
saveToStorage(key, updatedSubjects)
} catch (err) {
// eslint-disable-next-line
console.log('Error storing transaction subject in localstorage')
console.error('Error storing transaction subject in localstorage', err)
}
}