Skip to content

Commit

Permalink
cwebhook logs enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Sheetal-ayanworks committed Apr 25, 2024
1 parent 873aa78 commit ae8ec00
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions apps/webhook/src/webhook.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ export class WebhookService {

async webhookFunc(webhookUrl: string, data: object): Promise<Response> {
try {
console.log("webhookurl::" , webhookUrl)
const response = await fetch(webhookUrl, {
method: 'POST',
headers: {
Expand All @@ -97,8 +96,6 @@ 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);
}
Expand All @@ -110,13 +107,11 @@ export class WebhookService {

async webhookResponse(webhookUrl: string, data: object): Promise<object> {
try {
console.log("webhookurl::" , webhookUrl)
const webhookResponse = async (): Promise<Response> => 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);
}
}
Expand Down

0 comments on commit ae8ec00

Please sign in to comment.