Jackett.WebAPIExceptionLogger.LogAsync C# (CSharp) Method

LogAsync() public method

public LogAsync ( System.Web.Http.ExceptionHandling.ExceptionLoggerContext context, CancellationToken cancellationToken ) : Task
context System.Web.Http.ExceptionHandling.ExceptionLoggerContext
cancellationToken System.Threading.CancellationToken
return Task
        public async Task LogAsync(ExceptionLoggerContext context, CancellationToken cancellationToken)
        {
            // OWIN seems to give lots of these exceptions but we are not interested in them.
            if (context.Exception.Message != "Error while copying content to a stream.")
            {
                Engine.Logger.Error("Unhandled exception: " + context.Exception.GetExceptionDetails());
                var request = await context.Request.Content.ReadAsStringAsync();
                Engine.Logger.Error("Unhandled exception url: " + context.Request.RequestUri);
            }
        }
    }
WebAPIExceptionLogger