[PR #778] [MERGED] Throw ReaderCancelledException on reader cancelled #1217

Closed
opened 2026-01-29 22:19:32 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/adamhathcock/sharpcompress/pull/778
Author: @pathartl
Created: 11/11/2023
Status: Merged
Merged: 11/13/2023
Merged by: @adamhathcock

Base: masterHead: throw-cancelled-exception


📝 Commits (1)

  • ed4099e Throw ReaderCancelledException on reader cancelled

📊 Changes

2 files changed (+14 additions, -1 deletions)

View changed files

src/SharpCompress/Common/ReaderCancelledException.cs (+13 -0)
📝 src/SharpCompress/Readers/AbstractReader.cs (+1 -1)

📄 Description

I needed a way to gracefully handle a cancellation. It would have been much easier to catch a specific type of exception instead of relying on the message of InvalidOperationException.

So, here you go!


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/adamhathcock/sharpcompress/pull/778 **Author:** [@pathartl](https://github.com/pathartl) **Created:** 11/11/2023 **Status:** ✅ Merged **Merged:** 11/13/2023 **Merged by:** [@adamhathcock](https://github.com/adamhathcock) **Base:** `master` ← **Head:** `throw-cancelled-exception` --- ### 📝 Commits (1) - [`ed4099e`](https://github.com/adamhathcock/sharpcompress/commit/ed4099eb126afe4e6f05aaf29b84e614ba520c6e) Throw ReaderCancelledException on reader cancelled ### 📊 Changes **2 files changed** (+14 additions, -1 deletions) <details> <summary>View changed files</summary> ➕ `src/SharpCompress/Common/ReaderCancelledException.cs` (+13 -0) 📝 `src/SharpCompress/Readers/AbstractReader.cs` (+1 -1) </details> ### 📄 Description I needed a way to gracefully handle a cancellation. It would have been much easier to catch a specific type of exception instead of relying on the message of `InvalidOperationException`. So, here you go! --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 22:19:32 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#1217