mirror of https://github.com/apache/cloudstack.git
Merge a1df168243 into cd5bb09d0d
This commit is contained in:
commit
27bc99e1f4
|
|
@ -218,18 +218,19 @@ export const notifierPlugin = {
|
||||||
if (error.response.status) {
|
if (error.response.status) {
|
||||||
msg = `${i18n.global.t('message.request.failed')} (${error.response.status})`
|
msg = `${i18n.global.t('message.request.failed')} (${error.response.status})`
|
||||||
}
|
}
|
||||||
if (error.message) {
|
if (error.response.headers?.['x-description']) {
|
||||||
desc = error.message
|
|
||||||
}
|
|
||||||
if (error.response.headers && 'x-description' in error.response.headers) {
|
|
||||||
desc = error.response.headers['x-description']
|
desc = error.response.headers['x-description']
|
||||||
}
|
} else if (error.response.data) {
|
||||||
if (desc === '' && error.response.data) {
|
|
||||||
const responseKey = _.findKey(error.response.data, 'errortext')
|
const responseKey = _.findKey(error.response.data, 'errortext')
|
||||||
if (responseKey) {
|
if (responseKey) {
|
||||||
desc = error.response.data[responseKey].errortext
|
desc = error.response.data[responseKey].errortext
|
||||||
|
} else if (typeof error.response.data === 'string') {
|
||||||
|
desc = error.response.data
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!desc && error.message) {
|
||||||
|
desc = error.message
|
||||||
|
}
|
||||||
}
|
}
|
||||||
let countNotify = store.getters.countNotify
|
let countNotify = store.getters.countNotify
|
||||||
countNotify++
|
countNotify++
|
||||||
|
|
|
||||||
|
|
@ -638,11 +638,7 @@ export default {
|
||||||
this.$emit('refresh-data')
|
this.$emit('refresh-data')
|
||||||
this.closeAction()
|
this.closeAction()
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
this.$notification.error({
|
this.$notifyError(e)
|
||||||
message: this.$t('message.upload.failed'),
|
|
||||||
description: `${this.$t('message.upload.template.failed.description')} - ${e}`,
|
|
||||||
duration: 0
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
fetchCustomHypervisorName () {
|
fetchCustomHypervisorName () {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue