updated add series

This commit is contained in:
Keivan Beigi 2013-01-28 10:06:54 -08:00 committed by kay.one
parent f3e601d4ed
commit 0531029ce7
16 changed files with 243 additions and 29 deletions

View file

@ -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);
}
}
}