From 78329b7b9224bd427fd0e9b5e5378b53d57b06bc Mon Sep 17 00:00:00 2001 From: Bogdan Date: Mon, 28 Oct 2024 17:29:13 +0200 Subject: [PATCH] Improve exception message for invalid torrent files --- src/NzbDrone.Core/Indexers/TorrentIndexerBase.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Core/Indexers/TorrentIndexerBase.cs b/src/NzbDrone.Core/Indexers/TorrentIndexerBase.cs index 9676c2953..2dc9ae63f 100644 --- a/src/NzbDrone.Core/Indexers/TorrentIndexerBase.cs +++ b/src/NzbDrone.Core/Indexers/TorrentIndexerBase.cs @@ -1,3 +1,4 @@ +using System; using System.Text; using MonoTorrent; using NLog; @@ -22,10 +23,10 @@ namespace NzbDrone.Core.Indexers { Torrent.Load(fileData); } - catch + catch (Exception ex) { _logger.Debug("Invalid torrent file contents: {0}", Encoding.ASCII.GetString(fileData)); - throw; + throw new NotSupportedException($"Invalid torrent file contents. Reason: {ex.Message}", ex); } } }