Throw if failed to kill process during cancellation#308
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #308 +/- ##
==========================================
- Coverage 94.75% 94.48% -0.28%
==========================================
Files 46 45 -1
Lines 1202 1215 +13
Branches 88 89 +1
==========================================
+ Hits 1139 1148 +9
- Misses 38 42 +4
Partials 25 25 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR improves error handling when process termination fails during cancellation by throwing an explicit exception instead of silently continuing, and removes the custom CancellationTokenExtensions in favor of inline exception throwing.
Key Changes:
- Added explicit exception handling for process termination timeouts with a new
Win32Exceptionthrow when the process cannot be killed within the allotted timeout - Replaced the custom
ThrowIfCancellationRequestedextension method with inlineOperationCanceledExceptionthrows - Enhanced exception handling to better distinguish between internal cancellations (stdin, wait timeout) and user-requested cancellations
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| CliWrap/Utils/Extensions/CancellationTokenExtensions.cs | Removed custom extension method that wrapped cancellation token checking |
| CliWrap/Command.Execution.cs | Added System.ComponentModel import; refactored exception handling to throw explicit Win32Exception on termination timeout; replaced extension method calls with inline exception throwing; updated comments for stdin piping behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Updated [CliWrap](https://github.com/Tyrrrz/CliWrap) from 3.10.0 to 3.10.1. <details> <summary>Release notes</summary> _Sourced from [CliWrap's releases](https://github.com/Tyrrrz/CliWrap/releases)._ ## 3.10.1 ## What's Changed * Throw if failed to kill process during cancellation by @Tyrrrz in Tyrrrz/CliWrap#308 * Bump the nuget group with 4 updates by @dependabot[bot] in Tyrrrz/CliWrap#314 * Migrate to Centralized NuGet Package Management (CPM) by @Copilot in Tyrrrz/CliWrap#319 * Bump the nuget group with 6 updates by @dependabot[bot] in Tyrrrz/CliWrap#320 * Remove explicit Microsoft.SourceLink.GitHub package reference by @Copilot in Tyrrrz/CliWrap#321 * Use `LibraryImport` instead of `DllImport` for proper AOT support by @Copilot in Tyrrrz/CliWrap#323 ## New Contributors * @Copilot made their first contribution in Tyrrrz/CliWrap#319 **Full Changelog**: Tyrrrz/CliWrap@3.10...3.10.1 Commits viewable in [compare view](Tyrrrz/CliWrap@3.10...3.10.1). </details> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
No description provided.