mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-21 22:04:31 -04:00
added Logger injection module for Autofac, API boots up.
This commit is contained in:
@@ -16,11 +16,14 @@ namespace NzbDrone.Api.ErrorManagment
|
||||
|
||||
public Response HandleException(NancyContext context, Exception exception)
|
||||
{
|
||||
if (exception is ApiException)
|
||||
var apiException = exception as ApiException;
|
||||
|
||||
if (apiException != null)
|
||||
{
|
||||
_logger.WarnException("API Error", exception);
|
||||
return ((ApiException)exception).ToErrorResponse();
|
||||
_logger.WarnException("API Error", apiException);
|
||||
return apiException.ToErrorResponse();
|
||||
}
|
||||
|
||||
_logger.ErrorException("Unexpected error", exception);
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user