Skip to content

Commit

Permalink
try disposing process before throwing
Browse files Browse the repository at this point in the history
  • Loading branch information
rkm committed Jan 7, 2025
1 parent 42d75e9 commit 9b20ac3
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ public SmiCtpAnonymiser(GlobalOptions globalOptions)
while (_ctpProcess.StandardOutput.ReadLine() != "READY") { }
});
if (!readyTask.Wait(TimeSpan.FromSeconds(5)))
{
_ctpProcess.Dispose();
throw new Exception($"Did not receive READY before timeout. Stderr: {_ctpProcess.StandardError.ReadToEnd()}");
}
}

public ExtractedFileStatus Anonymise(IFileInfo sourceFile, IFileInfo destFile, string modality, out string? anonymiserStatusMessage)
Expand Down

0 comments on commit 9b20ac3

Please sign in to comment.