diff --git a/src/NzbDrone.Common/Extensions/ExceptionExtensions.cs b/src/NzbDrone.Common/Extensions/ExceptionExtensions.cs index c719cef3e..02f6440cc 100644 --- a/src/NzbDrone.Common/Extensions/ExceptionExtensions.cs +++ b/src/NzbDrone.Common/Extensions/ExceptionExtensions.cs @@ -34,6 +34,18 @@ namespace NzbDrone.Common.Extensions var contentSample = response.Content.Substring(0, Math.Min(response.Content.Length, 512)); + if (response.Request != null) + { + ex.AddData("RequestUri", response.Request.Url.ToString()); + + if (response.Request.ContentSummary != null) + { + ex.AddData("RequestSummary", response.Request.ContentSummary); + } + } + + ex.AddData("StatusCode", response.StatusCode.ToString()); + if (response.Headers != null) { ex.AddData("ContentType", response.Headers.ContentType ?? string.Empty); diff --git a/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs b/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs index d6545b8db..ce63250eb 100644 --- a/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs +++ b/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs @@ -301,8 +301,9 @@ namespace NzbDrone.Core.Indexers { return parser.ParseResponse(response).ToList(); } - catch (Exception) + catch (Exception ex) { + ex.WithData(response.HttpResponse, 128*1024); _logger.Trace("Unexpected Response content ({0} bytes): {1}", response.HttpResponse.ResponseData.Length, response.HttpResponse.Content); throw; }