From b1b5b6f7fb1758597eb50fbabc5fd8cfe57cfb01 Mon Sep 17 00:00:00 2001 From: PARK BYUNG JUN Date: Sun, 28 Aug 2022 15:43:49 +0000 Subject: [PATCH] error message is modified --- .../services/member_bank_deposit.service.ts | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/app/modules/polyglot/member_bank_deposit/services/member_bank_deposit.service.ts b/src/app/modules/polyglot/member_bank_deposit/services/member_bank_deposit.service.ts index eb7e119..a6f50f6 100644 --- a/src/app/modules/polyglot/member_bank_deposit/services/member_bank_deposit.service.ts +++ b/src/app/modules/polyglot/member_bank_deposit/services/member_bank_deposit.service.ts @@ -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); }); }