Improved error message when nzb download contains an newznab error instead

Signed-off-by: Robin Dadswell <robin@dadswell.email>
This commit is contained in:
Taloth Saldono
2020-04-16 22:16:50 +02:00
committed by Qstick
parent 24ab9768e9
commit db51254827
4 changed files with 39 additions and 0 deletions
@@ -11,5 +11,21 @@ namespace NzbDrone.Common.Extensions
{
return container.Descendants().Where(c => c.Name.LocalName.Equals(localName, StringComparison.InvariantCultureIgnoreCase));
}
public static bool TryGetAttributeValue(this XElement element, string name, out string value)
{
var attr = element.Attribute(name);
if (attr != null)
{
value = attr.Value;
return true;
}
else
{
value = null;
return false;
}
}
}
}