mirror of
https://github.com/Readarr/Readarr
synced 2026-02-05 14:22:32 +01:00
New: Log out body for bad API requests
This commit is contained in:
parent
5cc0331c75
commit
4a1b2af535
1 changed files with 7 additions and 1 deletions
|
|
@ -1,7 +1,10 @@
|
|||
using System;
|
||||
using System.Data.SQLite;
|
||||
using System.IO;
|
||||
using FluentValidation;
|
||||
using Nancy;
|
||||
using Nancy.Extensions;
|
||||
using Nancy.IO;
|
||||
using NLog;
|
||||
using NzbDrone.Core.Datastore;
|
||||
using NzbDrone.Core.Exceptions;
|
||||
|
|
@ -27,7 +30,10 @@ public Response HandleException(NancyContext context, Exception exception)
|
|||
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue