mirror of
https://github.com/Prowlarr/Prowlarr
synced 2025-12-27 02:44:35 +01:00
Avoid logging the whole response in the exception when not finding JSON selectors in Cardigann
This commit is contained in:
parent
5eb4d112ca
commit
c61cfcd312
1 changed files with 6 additions and 2 deletions
|
|
@ -227,7 +227,9 @@ protected string HandleJsonSelector(SelectorBlock selector, JToken parentObj, Di
|
|||
{
|
||||
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 @@ protected string HandleJsonSelector(SelectorBlock selector, JToken parentObj, Di
|
|||
{
|
||||
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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue