@yolo-croket-dev/core 1.9.2-jun.0 → 1.9.2-jun.2

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
- constructor(response: string | Record<string, any>, status: number, subMessage?: string | null, errInfo?: ErrInfo | null);
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;
@@ -38,14 +39,16 @@ async function AmqpHandler(client, messagePattern, payload) {
38
39
  action: data.errAction,
39
40
  errOption: data.errOption,
40
41
  };
42
+ const errOption = data.errOption;
41
43
  delete data.errType;
42
44
  delete data.errMessage;
43
45
  delete data.errAction;
46
+ delete data.errOption;
44
47
  delete data.isError;
45
48
  delete data.status;
46
49
  delete data.arg;
47
50
  delete data.subMessage;
48
- throw new HttpExceptionCustom(data, status, subMessage, errInfo);
51
+ throw new HttpExceptionCustom(data, status, subMessage, errInfo, errOption);
49
52
  }
50
53
  }
51
54
  catch (err) {
@@ -207,12 +207,14 @@ 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);
210
211
  const errMsg = err.response ? err.response : err.message;
211
212
  const status = err.status ? err.status : 500;
212
213
  const errType = err.errType;
213
214
  const errMessage = err.errMessage;
214
215
  const errAction = err.errAction;
215
216
  const errInfo = err.errInfo;
217
+ const errOption = err.errOption;
216
218
  const duration = Date.now() - now;
217
219
  let isAck = false;
218
220
  const isTimeoutError = err instanceof Error
@@ -232,6 +234,7 @@ let RPCInterceptor = class RPCInterceptor {
232
234
  errType,
233
235
  errMessage,
234
236
  errAction,
237
+ errOption,
235
238
  };
236
239
  if (!Number.isNaN(staticRetryCount)
237
240
  && staticRetryCount
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yolo-croket-dev/core",
3
- "version": "1.9.2-jun.0",
3
+ "version": "1.9.2-jun.2",
4
4
  "author": "Yolo Co., Ltd.",
5
5
  "description": "Yolo commonization module",
6
6
  "main": "index.js",