Fixed: Show correct error on unauthorized caps call

This commit is contained in:
Qstick 2023-09-18 03:09:12 -04:00 committed by GitHub
parent 7f2cd8a0e9
commit f2b0fc946e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -7,6 +7,7 @@ using NzbDrone.Common.Cache;
using NzbDrone.Common.Extensions; using NzbDrone.Common.Extensions;
using NzbDrone.Common.Http; using NzbDrone.Common.Http;
using NzbDrone.Common.Serializer; using NzbDrone.Common.Serializer;
using NzbDrone.Core.Indexers.Exceptions;
namespace NzbDrone.Core.Indexers.Newznab namespace NzbDrone.Core.Indexers.Newznab
{ {
@ -73,6 +74,13 @@ namespace NzbDrone.Core.Indexers.Newznab
_logger.Debug(ex, "Failed to parse newznab api capabilities for {0}", indexerSettings.BaseUrl); _logger.Debug(ex, "Failed to parse newznab api capabilities for {0}", indexerSettings.BaseUrl);
throw; throw;
} }
catch (ApiKeyException ex)
{
ex.WithData(response, 128 * 1024);
_logger.Trace("Unexpected Response content ({0} bytes): {1}", response.ResponseData.Length, response.Content);
_logger.Debug(ex, "Failed to parse newznab api capabilities for {0}, invalid API key", indexerSettings.BaseUrl);
throw;
}
catch (Exception ex) catch (Exception ex)
{ {
ex.WithData(response, 128 * 1024); ex.WithData(response, 128 * 1024);