@yolo-croket-dev/core 1.4.47-jun.9 → 1.4.48
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.
|
@@ -16,10 +16,10 @@ class HttpExceptionCustom extends common_1.HttpException {
|
|
|
16
16
|
exports.HttpExceptionCustom = HttpExceptionCustom;
|
|
17
17
|
// eslint-disable-next-line max-len
|
|
18
18
|
async function AmqpHandler(client, messagePattern, payload) {
|
|
19
|
-
var _a, _b;
|
|
20
|
-
let data
|
|
19
|
+
var _a, _b, _c;
|
|
20
|
+
let data;
|
|
21
21
|
try {
|
|
22
|
-
|
|
22
|
+
data = await (0, rxjs_1.lastValueFrom)(client.send(messagePattern, payload).pipe());
|
|
23
23
|
if (data.isError) {
|
|
24
24
|
const status = data.status || 500;
|
|
25
25
|
const subMessage = data.subMessage;
|
|
@@ -44,17 +44,19 @@ async function AmqpHandler(client, messagePattern, payload) {
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
catch (err) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
if (typeof err === 'string' && err.includes('There is no matching message handler defined in the remote service.')) {
|
|
48
|
+
msaLogger.error('NOT_EXISTS_MESSAGE_PATTERN', {
|
|
49
|
+
traceId: ((_b = payload === null || payload === void 0 ? void 0 : payload.param) === null || _b === void 0 ? void 0 : _b.traceId) || '-'
|
|
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
|
+
});
|
|
53
55
|
}
|
|
54
56
|
else {
|
|
55
57
|
msaLogger.error('AMQP_HANDLER_ERROR', {
|
|
56
|
-
traceId: ((
|
|
57
|
-
});
|
|
58
|
+
traceId: ((_c = payload === null || payload === void 0 ? void 0 : payload.param) === null || _c === void 0 ? void 0 : _c.traceId) || '-'
|
|
59
|
+
}, { err });
|
|
58
60
|
throw err;
|
|
59
61
|
}
|
|
60
62
|
}
|