@yolo-croket-dev/core 1.9.1 → 1.9.2-jun.1
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,11 +1,12 @@
|
|
|
1
1
|
import { ClientProxy } from '@nestjs/microservices';
|
|
2
2
|
import { HttpException } from '@nestjs/common';
|
|
3
3
|
import { AbstractRequest } from '..';
|
|
4
|
-
import { ErrInfo } from '../interfaces';
|
|
4
|
+
import { ErrInfo, MsaExceptionOption } from '../interfaces';
|
|
5
5
|
export declare class HttpExceptionCustom extends HttpException {
|
|
6
6
|
errInfo?: ErrInfo | null;
|
|
7
7
|
subMessage: string | null;
|
|
8
|
-
|
|
8
|
+
errOption?: MsaExceptionOption | null;
|
|
9
|
+
constructor(response: string | Record<string, any>, status: number, subMessage?: string | null, errInfo?: ErrInfo | null, errOption?: MsaExceptionOption | null);
|
|
9
10
|
}
|
|
10
11
|
export interface AbstractAmqpHandlerResponse<T> {
|
|
11
12
|
message: string;
|
|
@@ -10,10 +10,11 @@ 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, errOption) {
|
|
14
14
|
super(response, status);
|
|
15
15
|
this.subMessage = subMessage || null;
|
|
16
16
|
this.errInfo = errInfo || null;
|
|
17
|
+
this.errOption = errOption || null;
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
20
|
exports.HttpExceptionCustom = HttpExceptionCustom;
|
|
@@ -31,19 +32,23 @@ async function AmqpHandler(client, messagePattern, payload) {
|
|
|
31
32
|
* 다른 서비스에서 이미 처리가 될 수 있음
|
|
32
33
|
* */
|
|
33
34
|
(0, _1.reWriteFileValue)((_a = data === null || data === void 0 ? void 0 : data.arg) === null || _a === void 0 ? void 0 : _a.file);
|
|
35
|
+
console.log('data@@@@@@@', data);
|
|
34
36
|
const errInfo = data.errInfo ? data.errInfo : {
|
|
35
37
|
message: data.errMessage,
|
|
36
38
|
type: data.errType,
|
|
37
39
|
action: data.errAction,
|
|
40
|
+
errOption: data.errOption,
|
|
38
41
|
};
|
|
42
|
+
const errOption = data.errOption;
|
|
39
43
|
delete data.errType;
|
|
40
44
|
delete data.errMessage;
|
|
41
45
|
delete data.errAction;
|
|
46
|
+
delete data.errOption;
|
|
42
47
|
delete data.isError;
|
|
43
48
|
delete data.status;
|
|
44
49
|
delete data.arg;
|
|
45
50
|
delete data.subMessage;
|
|
46
|
-
throw new HttpExceptionCustom(data, status, subMessage, errInfo);
|
|
51
|
+
throw new HttpExceptionCustom(data, status, subMessage, errInfo, errOption);
|
|
47
52
|
}
|
|
48
53
|
}
|
|
49
54
|
catch (err) {
|
|
@@ -213,6 +213,7 @@ let RPCInterceptor = class RPCInterceptor {
|
|
|
213
213
|
const errMessage = err.errMessage;
|
|
214
214
|
const errAction = err.errAction;
|
|
215
215
|
const errInfo = err.errInfo;
|
|
216
|
+
const errOption = err.errOption;
|
|
216
217
|
const duration = Date.now() - now;
|
|
217
218
|
let isAck = false;
|
|
218
219
|
const isTimeoutError = err instanceof Error
|
|
@@ -232,6 +233,7 @@ let RPCInterceptor = class RPCInterceptor {
|
|
|
232
233
|
errType,
|
|
233
234
|
errMessage,
|
|
234
235
|
errAction,
|
|
236
|
+
errOption,
|
|
235
237
|
};
|
|
236
238
|
if (!Number.isNaN(staticRetryCount)
|
|
237
239
|
&& staticRetryCount
|
package/interfaces/amqp.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ErrAction } from './exception';
|
|
2
2
|
import { AbstractRequest, ErrInfo } from '.';
|
|
3
|
+
import { MsaExceptionOption } from './msa-exception';
|
|
3
4
|
export interface AbstractAmqpHandlerData {
|
|
4
5
|
isError?: boolean;
|
|
5
6
|
subMessage?: string | null;
|
|
@@ -13,6 +14,7 @@ export interface AbstractAmqpHandlerData {
|
|
|
13
14
|
errType?: string;
|
|
14
15
|
errMessage?: string;
|
|
15
16
|
errAction?: ErrAction;
|
|
17
|
+
errOption?: MsaExceptionOption;
|
|
16
18
|
}
|
|
17
19
|
/** Raw RabbitMQ Message */
|
|
18
20
|
export interface RawEventMessagePayload<Payload> {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MsaExceptionOption } from './msa-exception';
|
|
1
2
|
export declare enum ErrActionTypeEnum {
|
|
2
3
|
SERVER_PAUSE = "SERVER_PAUSE",
|
|
3
4
|
OPEN_WEBVIEW = "OPEN_WEBVIEW",
|
|
@@ -16,4 +17,5 @@ export declare class ErrInfo {
|
|
|
16
17
|
type?: string;
|
|
17
18
|
message?: string;
|
|
18
19
|
action?: ErrAction;
|
|
20
|
+
errOption?: MsaExceptionOption;
|
|
19
21
|
}
|
package/interfaces/exception.js
CHANGED
|
@@ -82,3 +82,10 @@ __decorate([
|
|
|
82
82
|
}),
|
|
83
83
|
__metadata("design:type", ErrAction)
|
|
84
84
|
], ErrInfo.prototype, "action", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, swagger_1.ApiProperty)({
|
|
87
|
+
description: '에러 옵션',
|
|
88
|
+
required: false,
|
|
89
|
+
}),
|
|
90
|
+
__metadata("design:type", Object)
|
|
91
|
+
], ErrInfo.prototype, "errOption", void 0);
|