File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -294,18 +294,19 @@ export const notifierPlugin = {
294294 if ( error . response . status ) {
295295 msg = `${ i18n . global . t ( 'message.request.failed' ) } (${ error . response . status } )`
296296 }
297- if ( error . message ) {
298- desc = error . message
299- }
300- if ( error . response . headers && 'x-description' in error . response . headers ) {
297+ if ( error . response . headers ?. [ 'x-description' ] ) {
301298 desc = error . response . headers [ 'x-description' ]
302- }
303- if ( desc === '' && error . response . data ) {
299+ } else if ( error . response . data ) {
304300 const responseKey = _ . findKey ( error . response . data , 'errortext' )
305301 if ( responseKey ) {
306302 desc = error . response . data [ responseKey ] . errortext
303+ } else if ( typeof error . response . data === 'string' ) {
304+ desc = error . response . data
307305 }
308306 }
307+ if ( ! desc && error . message ) {
308+ desc = error . message
309+ }
309310 }
310311 let countNotify = store . getters . countNotify
311312 countNotify ++
Original file line number Diff line number Diff line change @@ -684,11 +684,7 @@ export default {
684684 this .$emit (' refresh-data' )
685685 this .closeAction ()
686686 }).catch (e => {
687- this .$notification .error ({
688- message: this .$t (' message.upload.failed' ),
689- description: ` ${ this .$t (' message.upload.template.failed.description' )} - ${ e} ` ,
690- duration: 0
691- })
687+ this .$notifyError (e)
692688 })
693689 },
694690 fetchCustomHypervisorName () {
You can’t perform that action at this time.
0 commit comments