added Logger injection module for Autofac, API boots up.

This commit is contained in:
kay.one 2013-01-19 16:19:27 -08:00
commit 87f3c6a6c9
10 changed files with 78 additions and 23 deletions

View file

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