@yolo-croket-dev/core 1.9.2-jun.2 → 1.9.3-jun.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { ClientProxy } from '@nestjs/microservices';
|
|
2
2
|
import { HttpException } from '@nestjs/common';
|
|
3
3
|
import { AbstractRequest } from '..';
|
|
4
|
-
import { ErrInfo
|
|
4
|
+
import { ErrInfo } from '../interfaces';
|
|
5
5
|
export declare class HttpExceptionCustom extends HttpException {
|
|
6
6
|
errInfo?: ErrInfo | null;
|
|
7
7
|
subMessage: string | null;
|
|
8
|
-
|
|
9
|
-
constructor(response: string | Record<string, any>, status: number, subMessage?: string | null, errInfo?: ErrInfo | null, errOption?: MsaExceptionOption | null);
|
|
8
|
+
constructor(response: string | Record<string, any>, status: number, subMessage?: string | null, errInfo?: ErrInfo | null);
|
|
10
9
|
}
|
|
11
10
|
export interface AbstractAmqpHandlerResponse<T> {
|
|
12
11
|
message: string;
|
|
@@ -10,15 +10,13 @@ const DEFAULT_TIMEOUT = 1000 * 60 * 29; // 29분 타임아웃
|
|
|
10
10
|
const DEFAULT_TIMEOUT_MESSAGE = '요청이 타임아웃되었습니다.';
|
|
11
11
|
const msaLogger = new msa_logger_1.MsaLogger(msa_logger_1.ServerTypeEnum.SERVICE);
|
|
12
12
|
class HttpExceptionCustom extends common_1.HttpException {
|
|
13
|
-
constructor(response, status, subMessage, errInfo
|
|
13
|
+
constructor(response, status, subMessage, errInfo) {
|
|
14
14
|
super(response, status);
|
|
15
15
|
this.subMessage = subMessage || null;
|
|
16
16
|
this.errInfo = errInfo || null;
|
|
17
|
-
this.errOption = errOption || null;
|
|
18
17
|
}
|
|
19
18
|
}
|
|
20
19
|
exports.HttpExceptionCustom = HttpExceptionCustom;
|
|
21
|
-
// eslint-disable-next-line max-len
|
|
22
20
|
async function AmqpHandler(client, messagePattern, payload) {
|
|
23
21
|
var _a, _b, _c, _d;
|
|
24
22
|
let data;
|
|
@@ -39,7 +37,6 @@ async function AmqpHandler(client, messagePattern, payload) {
|
|
|
39
37
|
action: data.errAction,
|
|
40
38
|
errOption: data.errOption,
|
|
41
39
|
};
|
|
42
|
-
const errOption = data.errOption;
|
|
43
40
|
delete data.errType;
|
|
44
41
|
delete data.errMessage;
|
|
45
42
|
delete data.errAction;
|
|
@@ -48,7 +45,7 @@ async function AmqpHandler(client, messagePattern, payload) {
|
|
|
48
45
|
delete data.status;
|
|
49
46
|
delete data.arg;
|
|
50
47
|
delete data.subMessage;
|
|
51
|
-
throw new HttpExceptionCustom(data, status, subMessage, errInfo
|
|
48
|
+
throw new HttpExceptionCustom(data, status, subMessage, errInfo);
|
|
52
49
|
}
|
|
53
50
|
}
|
|
54
51
|
catch (err) {
|
|
@@ -207,7 +207,6 @@ let RPCInterceptor = class RPCInterceptor {
|
|
|
207
207
|
const noAck = message.fields.routingKey.includes('ASYNC');
|
|
208
208
|
let localErrorProcessor = async (err) => {
|
|
209
209
|
var _a;
|
|
210
|
-
console.log('err@@@@@@@ rpc가 있다고?', err);
|
|
211
210
|
const errMsg = err.response ? err.response : err.message;
|
|
212
211
|
const status = err.status ? err.status : 500;
|
|
213
212
|
const errType = err.errType;
|
|
@@ -229,8 +228,9 @@ let RPCInterceptor = class RPCInterceptor {
|
|
|
229
228
|
duration,
|
|
230
229
|
arg,
|
|
231
230
|
timestamp: new Date(),
|
|
232
|
-
//
|
|
231
|
+
// === Service-to-Service Error Data ===
|
|
233
232
|
errInfo,
|
|
233
|
+
// === Service-to-Gateway Error Data ===
|
|
234
234
|
errType,
|
|
235
235
|
errMessage,
|
|
236
236
|
errAction,
|