Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Commit

Permalink
Log rehydration errors to reactotron (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanlntn authored Sep 10, 2018
1 parent 69e591d commit 9c38d79
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion boilerplate/src/app/setup-root-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ export async function setupRootStore() {
// load data from storage
data = (await storage.load(ROOT_STATE_STORAGE_KEY)) || {}
rootStore = RootStoreModel.create(data, env)
} catch {
} catch(e) {
// if there's any problems loading, then let's at least fallback to an empty state
// instead of crashing.
rootStore = RootStoreModel.create({}, env)

// but please inform us what happened
__DEV__ && console.tron.error(e.message, null)
}

// reactotron logging
Expand Down

0 comments on commit 9c38d79

Please sign in to comment.