Skip to content

Commit

Permalink
Adding exception stack to result (#3311)
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyGaluzo authored May 24, 2023
1 parent 8c434af commit 024e174
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ public async Task<string> ExecuteAsync(JobInfo jobInfo, IProgress<string> progre
{
HttpStatusCode = HttpStatusCode.BadRequest,
ErrorMessage = processingEx.Message,
ErrorDetails = processingEx.ToString(),
};

// Cancel other processing jobs
Expand All @@ -207,6 +208,7 @@ public async Task<string> ExecuteAsync(JobInfo jobInfo, IProgress<string> progre
{
HttpStatusCode = HttpStatusCode.InternalServerError,
ErrorMessage = ex.Message,
ErrorDetails = ex.ToString(),
};

// Cancel processing jobs for critical error in orchestrator job
Expand All @@ -229,6 +231,7 @@ public async Task<string> ExecuteAsync(JobInfo jobInfo, IProgress<string> progre
{
HttpStatusCode = HttpStatusCode.InternalServerError,
ErrorMessage = ex.Message,
ErrorDetails = ex.ToString(),
};

throw new RetriableJobException(JsonConvert.SerializeObject(postProcessErrorResult));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,18 @@ public class ImportOrchestratorJobErrorResult
public HttpStatusCode HttpStatusCode { get; set; }

/// <summary>
/// Details error message
/// Error message
/// </summary>
public string ErrorMessage { get; set; }

/// <summary>
/// Inner error if there're multiple errors
/// </summary>
public ImportOrchestratorJobErrorResult InnerError { get; set; }

/// <summary>
/// Details
/// </summary>
public string ErrorDetails { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public async Task<string> ExecuteAsync(JobInfo jobInfo, IProgress<string> progre
catch (Exception ex)
{
_logger.LogInformation(ex, "Critical error in import processing job.");
var error = new ImportProcessingJobErrorResult() { Message = ex.Message };
var error = new ImportProcessingJobErrorResult() { Message = ex.Message, Details = ex.ToString() };
throw new JobExecutionException(ex.Message, error, ex);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ namespace Microsoft.Health.Fhir.Core.Features.Operations.Import
public class ImportProcessingJobErrorResult
{
public string Message { get; set; }

public string Details { get; set; }
}
}

0 comments on commit 024e174

Please sign in to comment.