mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Fix no-useless-catch issues (#9198)
See [`no-useless-catch`](https://eslint.org/docs/rules/no-useless-catch) for more information. This change enables `no-useless-catch` and fixes the issues raised by the rule.
This commit is contained in:
parent
a8863a3446
commit
9842b2f1ce
@ -48,6 +48,7 @@ module.exports = {
|
|||||||
'global-require': 'error',
|
'global-require': 'error',
|
||||||
'guard-for-in': 'error',
|
'guard-for-in': 'error',
|
||||||
'no-case-declarations': 'error',
|
'no-case-declarations': 'error',
|
||||||
|
'no-useless-catch': 'error',
|
||||||
/* End v2 rules */
|
/* End v2 rules */
|
||||||
'arrow-parens': 'error',
|
'arrow-parens': 'error',
|
||||||
'no-tabs': 'error',
|
'no-tabs': 'error',
|
||||||
|
@ -601,8 +601,6 @@ export default class MetamaskController extends EventEmitter {
|
|||||||
this.selectFirstIdentity()
|
this.selectFirstIdentity()
|
||||||
}
|
}
|
||||||
return vault
|
return vault
|
||||||
} catch (err) {
|
|
||||||
throw err
|
|
||||||
} finally {
|
} finally {
|
||||||
releaseLock()
|
releaseLock()
|
||||||
}
|
}
|
||||||
@ -658,8 +656,6 @@ export default class MetamaskController extends EventEmitter {
|
|||||||
this.preferencesController.setAddresses(accounts)
|
this.preferencesController.setAddresses(accounts)
|
||||||
this.selectFirstIdentity()
|
this.selectFirstIdentity()
|
||||||
return vault
|
return vault
|
||||||
} catch (err) {
|
|
||||||
throw err
|
|
||||||
} finally {
|
} finally {
|
||||||
releaseLock()
|
releaseLock()
|
||||||
}
|
}
|
||||||
@ -1402,13 +1398,9 @@ export default class MetamaskController extends EventEmitter {
|
|||||||
* @returns {Object} - MetaMask state
|
* @returns {Object} - MetaMask state
|
||||||
*/
|
*/
|
||||||
async createCancelTransaction (originalTxId, customGasPrice) {
|
async createCancelTransaction (originalTxId, customGasPrice) {
|
||||||
try {
|
|
||||||
await this.txController.createCancelTransaction(originalTxId, customGasPrice)
|
await this.txController.createCancelTransaction(originalTxId, customGasPrice)
|
||||||
const state = await this.getState()
|
const state = await this.getState()
|
||||||
return state
|
return state
|
||||||
} catch (error) {
|
|
||||||
throw error
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async createSpeedUpTransaction (originalTxId, customGasPrice, customGasLimit) {
|
async createSpeedUpTransaction (originalTxId, customGasPrice, customGasLimit) {
|
||||||
|
Loading…
Reference in New Issue
Block a user