Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding exception stack to job result #3311

Merged
merged 1 commit into from
May 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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; }
}
}