Skip to content

Commit

Permalink
Don't crash if the build options are bad.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnml1135 committed Jan 5, 2024
1 parent 9ec1e2a commit 2c1f65c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/SIL.Machine.AspNetCore/Services/NmtPreprocessBuildJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,14 @@ CancellationToken cancellationToken
_buildPreprocessSummary.Add("type", "nmt");
_buildPreprocessSummary.Add("engine_id", engineId);
_buildPreprocessSummary.Add("build_id", buildId);
_buildPreprocessSummary.Add("build_options", JsonNode.Parse(buildOptions!));
try
{
_buildPreprocessSummary.Add("build_options", JsonNode.Parse(buildOptions!));
}
catch (Exception)
{
_buildPreprocessSummary.Add("build_options", "Build options failed parsing: " + (buildOptions ?? "null"));
}
_buildPreprocessSummary.Add("corpora", JsonNode.Parse(JsonSerializer.Serialize(data)));

await WriteDataFilesAsync(buildId, data, buildOptions, cancellationToken);
Expand Down

0 comments on commit 2c1f65c

Please sign in to comment.