Fix TypeError when `signTypedData` throws (#9596)

If the `signTypedData` background function threw an exception, it would
return `undefined` to the UI, which would throw another exception in
the UI. It now re-throws the error if an error is thrown, which
allows the UI to handle the error.

I'm not sure why this might fail, and I'm not sure we're handling this
failure well, but this is an improvement at least.
feature/default_network_editable
Mark Stacey 4 years ago committed by GitHub
parent 7a1d93002d
commit 320e8c0af9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/scripts/metamask-controller.js

@ -1414,7 +1414,7 @@ export default class MetamaskController extends EventEmitter {
} catch (error) { } catch (error) {
log.info('MetaMaskController - eth_signTypedData failed.', error) log.info('MetaMaskController - eth_signTypedData failed.', error)
this.typedMessageManager.errorMessage(msgId, error) this.typedMessageManager.errorMessage(msgId, error)
return undefined throw error
} }
} }

Loading…
Cancel
Save