From 49dac0ebaa75a375885c05b1bd335d8f6fd68065 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sun, 17 Sep 2023 23:56:17 -0700 Subject: [PATCH] New: Don't treat 400 responses from Notifiarr as errors (cherry picked from commit 5eb420bbe12f59d0a5392abf3d351be28ca210e6) Closes #9194 --- .../Notifications/Notifiarr/NotifiarrProxy.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Core/Notifications/Notifiarr/NotifiarrProxy.cs b/src/NzbDrone.Core/Notifications/Notifiarr/NotifiarrProxy.cs index 52a60233a..f2313975b 100644 --- a/src/NzbDrone.Core/Notifications/Notifiarr/NotifiarrProxy.cs +++ b/src/NzbDrone.Core/Notifications/Notifiarr/NotifiarrProxy.cs @@ -1,4 +1,5 @@ using System.Net.Http; +using NLog; using NzbDrone.Common.Http; using NzbDrone.Common.Serializer; using NzbDrone.Core.Notifications.Webhook; @@ -14,10 +15,12 @@ namespace NzbDrone.Core.Notifications.Notifiarr { private const string URL = "https://notifiarr.com"; private readonly IHttpClient _httpClient; + private readonly Logger _logger; - public NotifiarrProxy(IHttpClient httpClient) + public NotifiarrProxy(IHttpClient httpClient, Logger logger) { _httpClient = httpClient; + _logger = logger; } public void SendNotification(WebhookPayload payload, NotifiarrSettings settings) @@ -49,7 +52,10 @@ namespace NzbDrone.Core.Notifications.Notifiarr case 401: throw new NotifiarrException("API key is invalid"); case 400: - throw new NotifiarrException("Unable to send notification. Ensure Radarr Integration is enabled & assigned a channel on Notifiarr"); + // 400 responses shouldn't be treated as an actual error because it's a misconfiguration + // between Radarr and Notifiarr for a specific event, but shouldn't stop all events. + _logger.Error("HTTP 400 - Unable to send notification. Ensure Radarr Integration is enabled & assigned a channel on Notifiarr"); + break; case 502: case 503: case 504: