public void Handle(Nancy.HttpStatusCode statusCode, Nancy.NancyContext context) { object error; var gotException = context.Items.TryGetValue(NancyEngine.ERROR_EXCEPTION, out error); if (!gotException) return; new Logger().Error("Web ErrorHandler", statusCode.ToString(), error as Exception); }