Commit 485b7af4bbe868c6f3255cad379fecc3db69dae6
1 parent
5e27716d8e
Exists in
master
Debug webhooksender dari core-response
Showing 2 changed files with 9 additions and 2 deletions Side-by-side Diff
lib/core-callback/sender.js
... | ... | @@ -73,8 +73,14 @@ const sender = async (data, xid, retry) => { |
73 | 73 | const isPostpaid = ['INQUIRY', 'PAY'].indexOf(data.command) >= 0; |
74 | 74 | const isHttpPost = isPostpaid; |
75 | 75 | |
76 | - const webhookType = 'KOMODO-CENTER-HTTPGETX.CORE-CALLBACK'; | |
77 | - webhookSender(xid, webhookType, params); | |
76 | + try { | |
77 | + const webhookType = 'KOMODO-CENTER-HTTPGETX.CORE-CALLBACK'; | |
78 | + webhookSender(xid, webhookType, params); | |
79 | + } catch (e) { | |
80 | + logger.warn(`${MODULE_NAME} 1E2BF2CD: Exception calling webhookSender`, { | |
81 | + xid, | |
82 | + }); | |
83 | + } | |
78 | 84 | |
79 | 85 | if (!data.reverse_url) { |
80 | 86 | logger.verbose(`${MODULE_NAME} C4FF18FB: Ignoring missing reverse url`, { |
lib/webhook-sender.js
... | ... | @@ -73,6 +73,7 @@ const sender = async (xid, webhookType, body, retry) => { |
73 | 73 | } catch (e) { |
74 | 74 | logger.warn(`${MODULE_NAME} ECC37ECA: Exception on calling webhook`, { |
75 | 75 | xid, |
76 | + httpStatusCode: e.response && e.response.status, | |
76 | 77 | eCode: e.code, |
77 | 78 | eMessage: e.message || e.toString(), |
78 | 79 | retried: retry || 0, |