Cleanse Log Exception Data (#83)

This commit is contained in:
Qstick
2017-09-02 06:39:21 -04:00
committed by GitHub
parent 0b22d7fce3
commit 0807fcc616
12 changed files with 283 additions and 34 deletions
+6 -5
View File
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
@@ -65,12 +65,14 @@ namespace NzbDrone.Core.Indexers
}
catch (UnsupportedFeedException itemEx)
{
itemEx.Data.Add("Item", item.Title());
itemEx.WithData("FeedUrl", indexerResponse.Request.Url);
itemEx.WithData("ItemTitle", item.Title());
throw;
}
catch (Exception itemEx)
{
itemEx.Data.Add("Item", item.Title());
itemEx.WithData("FeedUrl", indexerResponse.Request.Url);
itemEx.WithData("ItemTitle", item.Title());
_logger.Error(itemEx, "An error occurred while processing feed item from {0}", indexerResponse.Request.Url);
}
}
@@ -95,8 +97,7 @@ namespace NzbDrone.Core.Indexers
var contentSample = indexerResponse.Content.Substring(0, Math.Min(indexerResponse.Content.Length, 512));
_logger.Debug("Truncated response content (originally {0} characters): {1}", indexerResponse.Content.Length, contentSample);
ex.Data.Add("ContentLength", indexerResponse.Content.Length);
ex.Data.Add("ContentSample", contentSample);
ex.WithData(indexerResponse.HttpResponse);
throw;
}