From 873aa783f537fbc1df16e003312a3691ba7e8654 Mon Sep 17 00:00:00 2001 From: Sheetal Date: Thu, 25 Apr 2024 17:59:43 +0530 Subject: [PATCH] cwebhook logs enabled --- .github/workflows/dev-webhook.yml | 2 +- apps/webhook/src/webhook.service.ts | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dev-webhook.yml b/.github/workflows/dev-webhook.yml index 7319304db..e961699f3 100644 --- a/.github/workflows/dev-webhook.yml +++ b/.github/workflows/dev-webhook.yml @@ -3,7 +3,7 @@ name: Build and deploy Node.js app to ECSsdc on: push: branches: - - develop + - pipeline-implementation paths: - 'apps/webhook/**' workflow_dispatch: diff --git a/apps/webhook/src/webhook.service.ts b/apps/webhook/src/webhook.service.ts index d98bee504..6e257c40c 100644 --- a/apps/webhook/src/webhook.service.ts +++ b/apps/webhook/src/webhook.service.ts @@ -87,6 +87,7 @@ export class WebhookService { async webhookFunc(webhookUrl: string, data: object): Promise { try { + console.log("webhookurl::" , webhookUrl) const response = await fetch(webhookUrl, { method: 'POST', headers: { @@ -96,6 +97,8 @@ export class WebhookService { }); if (!response.ok) { + console.log("not ok response::" , response) + console.log("not ok response status::" , response.status) this.logger.error(`Error in sending webhook response to org webhook url:`, response.status); throw new InternalServerErrorException(ResponseMessages.webhook.error.webhookResponse); } @@ -107,11 +110,13 @@ export class WebhookService { async webhookResponse(webhookUrl: string, data: object): Promise { try { + console.log("webhookurl::" , webhookUrl) const webhookResponse = async (): Promise => this.webhookFunc(webhookUrl, data); const response = await AsyncRetry(webhookResponse, this.retryOptions(this.logger)); return response; } catch (error) { this.logger.error(`Error in sending webhook response to org webhook url: ${error}`); + console.log("error webhook::" , error) throw new RpcException(error.response ? error.response : error); } }