migratewizard: Display error and unfreeze form when api call fails (#912)

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
davidjumani 2021-01-05 14:34:08 +05:30 committed by Rohit Yadav
parent ecf5e92af9
commit f0d08c5978

View File

@ -177,8 +177,13 @@ export default {
})
this.$parent.$parent.close()
}).catch(error => {
console.error(error)
this.$message.error(`${this.$t('message.migrating.vm.to.host.failed')} ${this.selectedHost.name}`)
this.$notification.error({
message: this.$t('message.request.failed'),
description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message,
duration: 0
})
}).finally(() => {
this.loading = false
})
},
handleChangePage (page, pageSize) {