From f69369f2ea50bbdff278ef478e3967c000b56f45 Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Wed, 29 Apr 2020 17:25:42 +0530 Subject: [PATCH] requests: handle error in case of network errors Signed-off-by: Rohit Yadav --- ui/src/config/section/infra/routers.js | 2 +- ui/src/config/section/infra/systemVms.js | 2 +- ui/src/utils/request.js | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ui/src/config/section/infra/routers.js b/ui/src/config/section/infra/routers.js index c6eeaed22a6..92db3c80995 100644 --- a/ui/src/config/section/infra/routers.js +++ b/ui/src/config/section/infra/routers.js @@ -93,7 +93,7 @@ export default { }, { api: 'getDiagnosticsData', - icon: 'experiment', + icon: 'download', label: 'label.action.get.diagnostics', dataView: true, show: (record) => { return record.state === 'Running' }, diff --git a/ui/src/config/section/infra/systemVms.js b/ui/src/config/section/infra/systemVms.js index b616137cb27..67597b45319 100644 --- a/ui/src/config/section/infra/systemVms.js +++ b/ui/src/config/section/infra/systemVms.js @@ -84,7 +84,7 @@ export default { }, { api: 'getDiagnosticsData', - icon: 'experiment', + icon: 'download', label: 'label.action.get.diagnostics', dataView: true, show: (record) => { return record.state === 'Running' }, diff --git a/ui/src/utils/request.js b/ui/src/utils/request.js index 2abad07d6b6..962a2ad8497 100644 --- a/ui/src/utils/request.js +++ b/ui/src/utils/request.js @@ -55,6 +55,12 @@ const err = (error) => { this.$router.push({ path: '/exception/404' }) } } + if (error.isAxiosError && !error.response) { + notification.warn({ + message: error.message || 'Network Error', + description: 'Unable to reach the management server or a browser extension may be blocking the network request.' + }) + } return Promise.reject(error) }