error message is modified

This commit is contained in:
병준 박 2022-08-28 15:43:49 +00:00
parent d91f42c614
commit b1b5b6f7fb

View File

@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
import { NatsService } from 'app/core/nats/services/nats.service';
import * as nats from 'nats.ws';
import { Error } from 'app/modules/proto/protobuf/rpc_pb';
import { Error, InvalidParamsDetail } from 'app/modules/proto/protobuf/rpc_pb';
import {
ListMemberBankDepositsRequest,
@ -152,7 +152,22 @@ export class MemberBankDepositService {
return resolve(result);
})
.catch((e: Error) => {
console.log('failed', e);
const code = e.getCode();
const message = e.getMessage();
let data;
if (code == -32602) {
data = InvalidParamsDetail.deserializeBinary(e.getData_asU8());
} else {
data = e.getData();
}
console.log(
'failed code:',
code,
' message:',
message,
' data:',
data
);
return reject(e);
});
}