From dc3c1985b53a4d9ef237369ad2f6453fcac6ecf2 Mon Sep 17 00:00:00 2001 From: Daniel Ternyak Date: Wed, 5 Jul 2017 17:35:53 -0500 Subject: [PATCH] Logging: add warning log for exception during local storage parsing --- common/utils/localStorage.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/utils/localStorage.js b/common/utils/localStorage.js index 3f851d6f..d0eff4f3 100644 --- a/common/utils/localStorage.js +++ b/common/utils/localStorage.js @@ -9,7 +9,7 @@ export const loadState = () => { } return JSON.parse(serializedState); } catch (err) { - // TODO - log warning? or bubble? + console.warn(' Warning: corrupted local storage'); } }; @@ -18,7 +18,7 @@ export const saveState = (state: Object) => { const serializedState = JSON.stringify(state); localStorage.setItem(REDUX_STATE, serializedState); } catch (err) { - // TODO - log warning? or bubble? + console.warn(' Warning: corrupted local storage'); } };