Skip to content

Commit 0842a1c

Browse files
committed
Don't fail when trying to set resource policy on fast-exiting process
1 parent d606b4d commit 0842a1c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

CliWrap/Command.Execution.cs

+5
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,11 @@ CancellationToken gracefulCancellationToken
337337
ex
338338
);
339339
}
340+
catch (InvalidOperationException)
341+
{
342+
// This exception could indicate that the process has exited before we had a chance to set the policy.
343+
// This is not an exceptional situation, so we don't need to do anything here.
344+
}
340345
});
341346

342347
// Extract the process ID before calling ExecuteAsync(), because the process may

0 commit comments

Comments
 (0)