|
|
@ -66,9 +66,11 @@ export class DecisionApi implements Api { |
|
|
|
|
|
|
|
|
|
|
|
return new Promise((resolve, rejected) => { |
|
|
|
return new Promise((resolve, rejected) => { |
|
|
|
this.addEventListener(editStatusEvent.OPEN, res => { |
|
|
|
this.addEventListener(editStatusEvent.OPEN, res => { |
|
|
|
if (res.errorCode) { |
|
|
|
const data = JSON.parse(res.data); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (data.errorCode) { |
|
|
|
let errorMessage = ''; |
|
|
|
let errorMessage = ''; |
|
|
|
switch (res.errorCode) { |
|
|
|
switch (data.errorCode) { |
|
|
|
case errorCode.CONNECTION_DELETED: |
|
|
|
case errorCode.CONNECTION_DELETED: |
|
|
|
errorMessage = 'Dec-Dcm_Connection_Deleted'; |
|
|
|
errorMessage = 'Dec-Dcm_Connection_Deleted'; |
|
|
|
break; |
|
|
|
break; |
|
|
@ -76,13 +78,13 @@ export class DecisionApi implements Api { |
|
|
|
errorMessage = 'Dec-Dcm_Connection_Is_Using'; |
|
|
|
errorMessage = 'Dec-Dcm_Connection_Is_Using'; |
|
|
|
break; |
|
|
|
break; |
|
|
|
default: |
|
|
|
default: |
|
|
|
errorMessage = res.errorMsg; |
|
|
|
errorMessage = data.errorMessage; |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
BI.Msg.toast(BI.i18nText(errorMessage, res.errorMsg), { |
|
|
|
BI.Msg.toast(BI.i18nText(errorMessage, data.errorMessage), { |
|
|
|
level: 'error', |
|
|
|
level: 'error', |
|
|
|
}); |
|
|
|
}); |
|
|
|
rejected(res); |
|
|
|
rejected(data); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
resolve(res); |
|
|
|
resolve(res); |
|
|
|
} |
|
|
|
} |
|
|
|