Don't log invalid date in rss as Error.

Fixes #635
This commit is contained in:
Taloth Saldono 2015-07-07 22:20:16 +02:00
parent c5684439f4
commit 8917ea9cc9
1 changed files with 10 additions and 1 deletions

View File

@ -644,7 +644,16 @@ namespace NzbDrone.Core.Parser
airmonth = tempDay;
}
var airDate = new DateTime(airYear, airmonth, airday);
DateTime airDate;
try
{
airDate = new DateTime(airYear, airmonth, airday);
}
catch (Exception)
{
throw new InvalidDateException("Invalid date found: {0}-{1}-{2}", airYear, airmonth, airday);
}
//Check if episode is in the future (most likely a parse error)
if (airDate > DateTime.Now.AddDays(1).Date || airDate < new DateTime(1970, 1, 1))