New: Log out body for bad API requests

pull/5880/head
ta264 4 years ago committed by Qstick
parent 3a146ea667
commit 901723b8e3

@ -1,7 +1,10 @@
using System; using System;
using System.Data.SQLite; using System.Data.SQLite;
using System.IO;
using FluentValidation; using FluentValidation;
using Nancy; using Nancy;
using Nancy.Extensions;
using Nancy.IO;
using NLog; using NLog;
using NzbDrone.Core.Datastore; using NzbDrone.Core.Datastore;
using NzbDrone.Core.Exceptions; using NzbDrone.Core.Exceptions;
@ -26,7 +29,10 @@ namespace Radarr.Http.ErrorManagement
if (exception is ApiException apiException) if (exception is ApiException apiException)
{ {
_logger.Warn(apiException, "API Error"); _logger.Warn(apiException, "API Error:\n{0}", apiException.Message);
var body = RequestStream.FromStream(context.Request.Body).AsString();
_logger.Trace("Request body:\n{0}", body);
return apiException.ToErrorResponse(context); return apiException.ToErrorResponse(context);
} }

Loading…
Cancel
Save