From 65b25e63365a06c4e254a039ac8845cdcd728404 Mon Sep 17 00:00:00 2001 From: whimsical-c4lic0 Date: Wed, 18 Feb 2026 04:50:45 -0600 Subject: [PATCH] Avoid swallowing cancelation attempts via exception handling --- OF DL.Core/Services/ApiService.cs | 4 ++++ OF DL.Core/Services/DownloadService.cs | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/OF DL.Core/Services/ApiService.cs b/OF DL.Core/Services/ApiService.cs index 219d4ac..bd5238c 100644 --- a/OF DL.Core/Services/ApiService.cs +++ b/OF DL.Core/Services/ApiService.cs @@ -635,6 +635,10 @@ public class ApiService(IAuthService authService, IConfigService configService, return returnUrls; } + catch (OperationCanceledException) + { + throw; + } catch (Exception ex) { ExceptionLoggerHelper.LogException(ex); diff --git a/OF DL.Core/Services/DownloadService.cs b/OF DL.Core/Services/DownloadService.cs index 4051177..d9204d3 100644 --- a/OF DL.Core/Services/DownloadService.cs +++ b/OF DL.Core/Services/DownloadService.cs @@ -1,4 +1,5 @@ using System.Globalization; +using System.Diagnostics; using System.Security.Cryptography; using System.Text.RegularExpressions; using FFmpeg.NET; @@ -262,6 +263,10 @@ public class DownloadService( Constants.DrmDownloadMaxRetries, mediaId); return false; } + catch (OperationCanceledException) + { + throw; + } catch (Exception ex) { ExceptionLoggerHelper.LogException(ex);