Skip to content

Commit

Permalink
Adds exception block for handling unauthorized exception (#3604)
Browse files Browse the repository at this point in the history
* Adds extra exception block for handling unauthorized exception

* warning messaged changed

* warning message updated

* commited once again
  • Loading branch information
mahajan-xor authored Nov 30, 2023
1 parent 36480e5 commit 88674d0
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -111,6 +112,12 @@ public async Task<string> ExecuteAsync(JobInfo jobInfo, IProgress<string> progre
{
throw;
}
catch (RequestFailedException ex) when (ex.Status == 403)
{
_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)
{
_logger.LogError(ex, "Failed to load data.");
Expand Down

0 comments on commit 88674d0

Please sign in to comment.