requests: handle error in case of network errors

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2020-04-29 17:25:42 +05:30
parent 922fd06451
commit f69369f2ea
3 changed files with 8 additions and 2 deletions

View File

@ -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' },

View File

@ -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' },

View File

@ -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)
}