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