Skip to content
This repository has been archived by the owner on Sep 27, 2019. It is now read-only.

Catch web3 initialization errors properly #60

Merged
merged 2 commits into from
May 29, 2018

Conversation

sliptype
Copy link

Summary

The WEB3_FAILED action is never being dispatched. This is because when injected web3 is missing, the error is caught in initializeDrizzle instead of callInitializeWeb3. This is causing web3.status in the redux state to be 'initialized'.

Steps to reproduce

Initialize drizzle without metamask enabled.

Changes included in PR

  • callInitializeWeb3 is removed in favor of wrapping the contents of initializeWeb3 in a try...catch
  • store.dispatch({type: 'WEB3_FAILED', error}) is replaced with yield put({type: 'WEB3_FAILED', error})
  • The existence of web3 is asserted in initializeDrizzle

@OnlyOneJMJQ OnlyOneJMJQ merged commit d97f110 into trufflesuite:master May 29, 2018
@OnlyOneJMJQ
Copy link
Contributor

Thank you @sklingler93 , good catch!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants