mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Avoid logging the whole response in the exception when not finding JSON selectors in Cardigann
This commit is contained in:
@@ -227,7 +227,9 @@ namespace NzbDrone.Core.Indexers.Definitions.Cardigann
|
||||
{
|
||||
if (required)
|
||||
{
|
||||
throw new Exception($"Selector \"{selectorSelector}\" didn't match {parentObj.ToString(Formatting.None)}");
|
||||
var jsonContent = parentObj.ToString(Formatting.None);
|
||||
|
||||
throw new Exception($"Selector \"{selectorSelector}\" didn't match JSON content").WithData("JsonContent", jsonContent[..Math.Min(jsonContent.Length, 5 * 1024)]);
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -260,7 +262,9 @@ namespace NzbDrone.Core.Indexers.Definitions.Cardigann
|
||||
{
|
||||
if (required)
|
||||
{
|
||||
throw new Exception($"None of the case selectors \"{string.Join(",", selector.Case)}\" matched {parentObj.ToString(Formatting.None)}");
|
||||
var jsonContent = parentObj.ToString(Formatting.None);
|
||||
|
||||
throw new Exception($"None of the case selectors \"{string.Join(",", selector.Case)}\" matched JSON content").WithData("JsonContent", jsonContent[..Math.Min(jsonContent.Length, 5 * 1024)]);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
Reference in New Issue
Block a user