mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 21:43:33 -07:00
added Logger injection module for Autofac, API boots up.
This commit is contained in:
parent
64a3e1caf0
commit
87f3c6a6c9
10 changed files with 78 additions and 23 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue