From 6eb1d2caa282ce3d77d6c1fc77d9373ceda1e5d2 Mon Sep 17 00:00:00 2001 From: Anil Mahajan Date: Wed, 29 Nov 2023 14:05:51 +0530 Subject: [PATCH 1/4] Adds extra exception block for handling unauthorized exception --- .../Features/Operations/Import/ImportProcessingJob.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Microsoft.Health.Fhir.SqlServer/Features/Operations/Import/ImportProcessingJob.cs b/src/Microsoft.Health.Fhir.SqlServer/Features/Operations/Import/ImportProcessingJob.cs index 539197b187..62a4f067a2 100644 --- a/src/Microsoft.Health.Fhir.SqlServer/Features/Operations/Import/ImportProcessingJob.cs +++ b/src/Microsoft.Health.Fhir.SqlServer/Features/Operations/Import/ImportProcessingJob.cs @@ -8,6 +8,7 @@ using System.Threading; using System.Threading.Channels; using System.Threading.Tasks; +using Azure; using EnsureThat; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Primitives; @@ -111,6 +112,12 @@ public async Task ExecuteAsync(JobInfo jobInfo, IProgress progre { throw; } + catch (RequestFailedException ex) when (ex.Status == 403) + { + _logger.LogInformation(ex, "Import processing operation is failed."); + var error = new ImportProcessingJobErrorResult() { Message = "Import processing operation is failed." }; + throw new JobExecutionException(ex.Message, error, ex); + } catch (Exception ex) { _logger.LogError(ex, "Failed to load data."); From b3cb1ba57e436b1aa3f145535c065cc38ba24c13 Mon Sep 17 00:00:00 2001 From: Anil Mahajan Date: Wed, 29 Nov 2023 20:57:06 +0530 Subject: [PATCH 2/4] warning messaged changed --- .../Features/Operations/Import/ImportProcessingJob.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.Health.Fhir.SqlServer/Features/Operations/Import/ImportProcessingJob.cs b/src/Microsoft.Health.Fhir.SqlServer/Features/Operations/Import/ImportProcessingJob.cs index 62a4f067a2..fd4e6d3026 100644 --- a/src/Microsoft.Health.Fhir.SqlServer/Features/Operations/Import/ImportProcessingJob.cs +++ b/src/Microsoft.Health.Fhir.SqlServer/Features/Operations/Import/ImportProcessingJob.cs @@ -114,8 +114,8 @@ public async Task ExecuteAsync(JobInfo jobInfo, IProgress progre } catch (RequestFailedException ex) when (ex.Status == 403) { - _logger.LogInformation(ex, "Import processing operation is failed."); - var error = new ImportProcessingJobErrorResult() { Message = "Import processing operation is failed." }; + _logger.LogInformation(ex, "Due to unauthorized request import processing operation is failed."); + var error = new ImportProcessingJobErrorResult() { Message = "Due to unauthorized request import processing operation is failed." }; throw new JobExecutionException(ex.Message, error, ex); } catch (Exception ex) From 5082adc8578b4377d2802d42c3a6a9994c228d67 Mon Sep 17 00:00:00 2001 From: Anil Mahajan Date: Wed, 29 Nov 2023 21:00:56 +0530 Subject: [PATCH 3/4] warning message updated --- .../Features/Operations/Import/ImportProcessingJob.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.Health.Fhir.SqlServer/Features/Operations/Import/ImportProcessingJob.cs b/src/Microsoft.Health.Fhir.SqlServer/Features/Operations/Import/ImportProcessingJob.cs index fd4e6d3026..3a4145d777 100644 --- a/src/Microsoft.Health.Fhir.SqlServer/Features/Operations/Import/ImportProcessingJob.cs +++ b/src/Microsoft.Health.Fhir.SqlServer/Features/Operations/Import/ImportProcessingJob.cs @@ -114,8 +114,8 @@ public async Task ExecuteAsync(JobInfo jobInfo, IProgress progre } catch (RequestFailedException ex) when (ex.Status == 403) { - _logger.LogInformation(ex, "Due to unauthorized request import processing operation is failed."); - var error = new ImportProcessingJobErrorResult() { Message = "Due to unauthorized request import processing operation is failed." }; + _logger.LogInformation(ex, "Due to unauthorized request, the import processing operation failed."); + var error = new ImportProcessingJobErrorResult() { Message = "Due to unauthorized request, the import processing operation failed." }; throw new JobExecutionException(ex.Message, error, ex); } catch (Exception ex) From 43af74f79bbf4f9f6388ef5be22b3fa58de37b30 Mon Sep 17 00:00:00 2001 From: Anil Mahajan Date: Wed, 29 Nov 2023 21:11:43 +0530 Subject: [PATCH 4/4] commited once again --- .../Features/Operations/Import/ImportProcessingJob.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.Health.Fhir.SqlServer/Features/Operations/Import/ImportProcessingJob.cs b/src/Microsoft.Health.Fhir.SqlServer/Features/Operations/Import/ImportProcessingJob.cs index 3a4145d777..4098c6bcff 100644 --- a/src/Microsoft.Health.Fhir.SqlServer/Features/Operations/Import/ImportProcessingJob.cs +++ b/src/Microsoft.Health.Fhir.SqlServer/Features/Operations/Import/ImportProcessingJob.cs @@ -114,8 +114,8 @@ public async Task ExecuteAsync(JobInfo jobInfo, IProgress progre } catch (RequestFailedException ex) when (ex.Status == 403) { - _logger.LogInformation(ex, "Due to unauthorized request, the import processing operation failed."); - var error = new ImportProcessingJobErrorResult() { Message = "Due to unauthorized request, the import processing operation failed." }; + _logger.LogInformation(ex, "Due to unauthorized request, import processing operation failed."); + var error = new ImportProcessingJobErrorResult() { Message = "Due to unauthorized request, import processing operation failed." }; throw new JobExecutionException(ex.Message, error, ex); } catch (Exception ex)