Add 404 and 503 to targeted exclusions from hard failure at Download stage of Crawl

This commit is contained in:
Jacob Alber 2017-10-06 11:05:32 -04:00
Родитель a8874661f7
Коммит bf9fccafdd
1 изменённых файлов: 12 добавлений и 2 удалений

Просмотреть файл

@ -116,8 +116,18 @@ namespace Microsoft.DecisionService.Crawl
}
catch (WebException we)
{
if ((we.Response as HttpWebResponse)?.StatusCode == HttpStatusCode.Forbidden)
continue;
HttpWebResponse httpResponse = we.Response as HttpWebResponse;
if (httpResponse != null)
{
// Ignore known cases where crawl fails due to error on the crawl-target side - these should not
// cause a hard failure on our end.
if (httpResponse.StatusCode == HttpStatusCode.Forbidden ||
httpResponse.StatusCode == HttpStatusCode.NotFound ||
httpResponse.StatusCode == HttpStatusCode.ServiceUnavailable)
{
continue;
}
}
throw;
}