This commit is contained in:
crusader 2017-08-16 14:16:08 +09:00
parent c71d3541a6
commit 1c32a26e8b

View File

@ -146,12 +146,30 @@ export default class WebSocketRPC {
console.log(result);
promise.resolve(result);
} else if (null != error) {
if (ErrorCode.E_RUNTIME === error.Code) {
const returnError: Error = {
name: error.Message,
message: null,
};
promise.reject(returnError);
if (ErrorCode.E_INTERNAL === error.Code) {
if (undefined !== error.Message) {
const msgs = error.Message.split('|');
let errorName: string;
let errorMessage: string;
switch (msgs.length) {
case 1:
errorName = msgs[0];
break;
case 2:
errorName = msgs[0];
errorMessage = msgs[1];
break;
default:
break;
}
const returnError: Error = {
name: errorName,
message: errorMessage,
};
promise.reject(returnError);
} else {
console.log(`System error[${error.Message}]`);
}
} else {
console.log(`System error[${error.Code}|${error.Message}|${error.Data}]`);
}