mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
updated add series
This commit is contained in:
parent
f3e601d4ed
commit
0531029ce7
16 changed files with 243 additions and 29 deletions
|
@ -2,6 +2,7 @@
|
|||
using System.Linq;
|
||||
using NLog;
|
||||
using Nancy;
|
||||
using NzbDrone.Api.Extentions;
|
||||
|
||||
namespace NzbDrone.Api.ErrorManagment
|
||||
{
|
||||
|
@ -17,15 +18,21 @@ namespace NzbDrone.Api.ErrorManagment
|
|||
public Response HandleException(NancyContext context, Exception exception)
|
||||
{
|
||||
var apiException = exception as ApiException;
|
||||
|
||||
|
||||
if (apiException != null)
|
||||
{
|
||||
_logger.WarnException("API Error", apiException);
|
||||
return apiException.ToErrorResponse();
|
||||
}
|
||||
|
||||
|
||||
_logger.ErrorException("Unexpected error", exception);
|
||||
return null;
|
||||
|
||||
|
||||
return new ErrorModel()
|
||||
{
|
||||
Message = exception.Message,
|
||||
Description = exception.ToString()
|
||||
}.AsResponse(HttpStatusCode.InternalServerError);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue