From d502fe6880bf36368382fc74894abc13ed265e6a Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Mon, 19 Nov 2018 15:20:07 +0100 Subject: [PATCH 1/2] Add default case to switch --- .../src/RequireHealthOverlay/RequireHealthOverlay.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/fether-react/src/RequireHealthOverlay/RequireHealthOverlay.js b/packages/fether-react/src/RequireHealthOverlay/RequireHealthOverlay.js index 3c1ac3dd4..39ccfa800 100644 --- a/packages/fether-react/src/RequireHealthOverlay/RequireHealthOverlay.js +++ b/packages/fether-react/src/RequireHealthOverlay/RequireHealthOverlay.js @@ -19,6 +19,8 @@ function statusMatches (status, require) { ); case 'sync': return status === STATUS.GOOD; + default: + return false; } } From 0538928dc84a16a1f355de779526c6b3bfd7cc4f Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Mon, 19 Nov 2018 15:22:00 +0100 Subject: [PATCH 2/2] Throw error instead --- .../src/RequireHealthOverlay/RequireHealthOverlay.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/fether-react/src/RequireHealthOverlay/RequireHealthOverlay.js b/packages/fether-react/src/RequireHealthOverlay/RequireHealthOverlay.js index 39ccfa800..f05bf1d2e 100644 --- a/packages/fether-react/src/RequireHealthOverlay/RequireHealthOverlay.js +++ b/packages/fether-react/src/RequireHealthOverlay/RequireHealthOverlay.js @@ -20,7 +20,7 @@ function statusMatches (status, require) { case 'sync': return status === STATUS.GOOD; default: - return false; + throw new Error(`Status '${status}' must be one of 'connected|sync'.`); } }