@yolo-croket-dev/core 1.4.47-jun.12 → 1.4.47-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.
|
@@ -4,6 +4,7 @@ exports.AmqpHandler = exports.HttpExceptionCustom = void 0;
|
|
|
4
4
|
const common_1 = require("@nestjs/common");
|
|
5
5
|
const rxjs_1 = require("rxjs");
|
|
6
6
|
const msa_logger_1 = require("@yolo-croket-dev/msa-logger");
|
|
7
|
+
const __1 = require("..");
|
|
7
8
|
const _1 = require(".");
|
|
8
9
|
const msaLogger = new msa_logger_1.MsaLogger(msa_logger_1.ServerTypeEnum.SERVICE);
|
|
9
10
|
class HttpExceptionCustom extends common_1.HttpException {
|
|
@@ -16,7 +17,7 @@ class HttpExceptionCustom extends common_1.HttpException {
|
|
|
16
17
|
exports.HttpExceptionCustom = HttpExceptionCustom;
|
|
17
18
|
// eslint-disable-next-line max-len
|
|
18
19
|
async function AmqpHandler(client, messagePattern, payload) {
|
|
19
|
-
var _a
|
|
20
|
+
var _a;
|
|
20
21
|
let data;
|
|
21
22
|
try {
|
|
22
23
|
data = await (0, rxjs_1.lastValueFrom)(client.send(messagePattern, payload).pipe());
|
|
@@ -44,19 +45,14 @@ async function AmqpHandler(client, messagePattern, payload) {
|
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
catch (err) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}, { err });
|
|
51
|
-
throw new HttpExceptionCustom('해당 메시지 패턴은 존재하지 않습니다.', 404, 'There is no matching message handler defined in the remote service.', {
|
|
52
|
-
type: 'NOT_EXISTS_MESSAGE_PATTERN',
|
|
53
|
-
message: '해당 메시지 패턴은 존재하지 않습니다.'
|
|
54
|
-
});
|
|
48
|
+
console.error('payload @@@', payload);
|
|
49
|
+
if (err === 'There is no matching message handler defined in the remote service') {
|
|
50
|
+
throw new __1.BadRequest('NOT_EXISTS_SERVICE', 'There is no matching message handler defined in the remote service');
|
|
55
51
|
}
|
|
56
52
|
else {
|
|
57
53
|
msaLogger.error('AMQP_HANDLER_ERROR', {
|
|
58
|
-
traceId:
|
|
59
|
-
}
|
|
54
|
+
traceId: ''
|
|
55
|
+
});
|
|
60
56
|
throw err;
|
|
61
57
|
}
|
|
62
58
|
}
|