From 2df535b2e6eaa864338cc76d275a9bc3048e1f24 Mon Sep 17 00:00:00 2001 From: Pravin Varade Date: Thu, 3 Oct 2024 14:42:58 +0530 Subject: [PATCH] 177902-Exception logs format fixed AB#177902 --- src/UKHO.ERPFacade.API/Controllers/WebhookController.cs | 4 ++-- .../Services/AggregationService.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/UKHO.ERPFacade.API/Controllers/WebhookController.cs b/src/UKHO.ERPFacade.API/Controllers/WebhookController.cs index 1262cf78..91a2217b 100644 --- a/src/UKHO.ERPFacade.API/Controllers/WebhookController.cs +++ b/src/UKHO.ERPFacade.API/Controllers/WebhookController.cs @@ -107,7 +107,7 @@ public virtual async Task NewEncContentPublishedEventReceived([Fr if (!response.IsSuccessStatusCode) { - throw new ERPFacadeException(EventIds.RequestToSapFailed.ToEventId(), "An error occurred while sending a request to SAP. | {StatusCode}", response.StatusCode); + throw new ERPFacadeException(EventIds.RequestToSapFailed.ToEventId(), $"An error occurred while sending a request to SAP. | {response.StatusCode}"); } _logger.LogInformation(EventIds.EncUpdateSentToSap.ToEventId(), "ENC update has been sent to SAP successfully. | {StatusCode}", response.StatusCode); @@ -216,7 +216,7 @@ public virtual async Task LicenceUpdatedPublishedEventReceived([F if (!response.IsSuccessStatusCode) { - throw new ERPFacadeException(EventIds.ErrorOccurredInSapForLicenceUpdatedPublishedEvent.ToEventId(), "An error occurred while sending licence updated event data to SAP. | {StatusCode}", response.StatusCode); + throw new ERPFacadeException(EventIds.ErrorOccurredInSapForLicenceUpdatedPublishedEvent.ToEventId(), $"An error occurred while sending licence updated event data to SAP. | {response.StatusCode}"); } _logger.LogInformation(EventIds.LicenceUpdatedPublishedEventUpdatePushedToSap.ToEventId(), "The licence updated event data has been sent to SAP successfully. | {StatusCode}", response.StatusCode); diff --git a/src/UKHO.ERPFacade.EventAggregation.WebJob/Services/AggregationService.cs b/src/UKHO.ERPFacade.EventAggregation.WebJob/Services/AggregationService.cs index ee47aceb..c8fa4ed7 100644 --- a/src/UKHO.ERPFacade.EventAggregation.WebJob/Services/AggregationService.cs +++ b/src/UKHO.ERPFacade.EventAggregation.WebJob/Services/AggregationService.cs @@ -76,7 +76,7 @@ public async Task MergeRecordOfSaleEvents(QueueMessage queueMessage) if (!response.IsSuccessStatusCode) { - throw new ERPFacadeException(EventIds.ErrorOccurredInSapForRecordOfSalePublishedEvent.ToEventId(), "An error occurred while sending record of sale event data to SAP. | _X-Correlation-ID : {_X-Correlation-ID} | EventID : {EventID} | StatusCode: {StatusCode}", message.CorrelationId, message.EventId, response.StatusCode); + throw new ERPFacadeException(EventIds.ErrorOccurredInSapForRecordOfSalePublishedEvent.ToEventId(), $"An error occurred while sending record of sale event data to SAP. | _X-Correlation-ID : {message.CorrelationId} | EventID : {message.EventId} | StatusCode: {response.StatusCode}"); } _logger.LogInformation(EventIds.RecordOfSalePublishedEventDataPushedToSap.ToEventId(), "The record of sale event data has been sent to SAP successfully. | _X-Correlation-ID : {_X-Correlation-ID} | EventID : {EventID} | StatusCode: {StatusCode}", message.CorrelationId, message.EventId, response.StatusCode); @@ -96,7 +96,7 @@ public async Task MergeRecordOfSaleEvents(QueueMessage queueMessage) } catch (Exception) { - throw new ERPFacadeException(EventIds.UnhandledWebJobException.ToEventId(), "Exception occurred while processing Event Aggregation WebJob. | _X-Correlation-ID : {_X-Correlation-ID} | EventID : {EventID}", message.CorrelationId, message.EventId); + throw new ERPFacadeException(EventIds.UnhandledWebJobException.ToEventId(), $"Exception occurred while processing Event Aggregation WebJob. | _X-Correlation-ID : {message.CorrelationId} | EventID : {message.EventId}"); } } }