Skip to content

Commit

Permalink
address review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
brettfo committed Jan 7, 2025
1 parent 2808ab4 commit ec7854f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@ public class RequirementConverter : JsonConverter<Requirement>
{
public override Requirement? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
if (reader.TokenType != JsonTokenType.String)
{
throw new BadRequirementException($"Expected token type {nameof(JsonTokenType.String)}, but found {reader.TokenType}.");
}

var text = reader.GetString();
if (text is null)
{
throw new ArgumentNullException(nameof(text));
throw new BadRequirementException("Unexpected null token.");
}

try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ public async Task<int> RunAsync(FileInfo jobFilePath, DirectoryInfo repoContents
try
{
jobFile = RunWorker.Deserialize(jobFileContent);
if (jobFile is null)
{
parseError = new UnknownError(new Exception("Job file could not be deserialized"), _jobId);
}
}
catch (BadRequirementException ex)
{
Expand Down

0 comments on commit ec7854f

Please sign in to comment.