From a49188a606868a7af3bb439e4ae79a15c7d2a489 Mon Sep 17 00:00:00 2001 From: Praveen Durairaj Date: Wed, 5 Sep 2018 18:38:19 +0530 Subject: [PATCH] console: handle non access key errors (#356) [skip ci] --- .../src/components/Services/Data/DataRouter.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/console/src/components/Services/Data/DataRouter.js b/console/src/components/Services/Data/DataRouter.js index 2a1df51611a..e9edc929de1 100644 --- a/console/src/components/Services/Data/DataRouter.js +++ b/console/src/components/Services/Data/DataRouter.js @@ -194,12 +194,16 @@ const dataRouter = (connect, store, composeOnEnterHooks) => { }, error => { console.error(JSON.stringify(error)); - Promise.all([ - store.dispatch({ type: ACCESS_KEY_ERROR, data: true }), - ]).then(() => { - replaceState('/login'); - cb(); - }); + if (error.code === 'access-denied') { + Promise.all([ + store.dispatch({ type: ACCESS_KEY_ERROR, data: true }), + ]).then(() => { + replaceState('/login'); + cb(); + }); + } else { + alert(JSON.stringify(error)); + } } ); }