mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-31 03:11:07 +02:00
parent
e8c5e417b6
commit
f719c5ccf1
@ -20,10 +20,5 @@ public InvalidNzbException(string message, Exception innerException, params obje
|
||||
public InvalidNzbException(string message, Exception innerException) : base(message, innerException)
|
||||
{
|
||||
}
|
||||
|
||||
public InvalidNzbException(string message, string nzbName)
|
||||
: base($"{message} [{0}]", nzbName)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -24,12 +24,12 @@ public void Validate(string filename, byte[] fileContent)
|
||||
|
||||
if (nzb == null)
|
||||
{
|
||||
throw new InvalidNzbException("No Root element", filename);
|
||||
throw new InvalidNzbException("Invalid NZB: No Root element [{0}]", filename);
|
||||
}
|
||||
|
||||
if (!nzb.Name.LocalName.Equals("nzb"))
|
||||
{
|
||||
throw new InvalidNzbException("Invalid root element", filename);
|
||||
throw new InvalidNzbException("Invalid NZB: Unexpected root element. Expected 'nzb' found '{0}' [{1}]", nzb.Name.LocalName, filename);
|
||||
}
|
||||
|
||||
var ns = nzb.Name.Namespace;
|
||||
@ -37,7 +37,7 @@ public void Validate(string filename, byte[] fileContent)
|
||||
|
||||
if (files.Empty())
|
||||
{
|
||||
throw new InvalidNzbException("No files", filename);
|
||||
throw new InvalidNzbException("Invalid NZB: No files [{0}]", filename);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user