Log Caught Exceptions with Sentry in dotnet core

In a mvc dotnet core application I have middleware that handles all exceptions so that I can return standardized HTTP response codes.
This in turns does not allow errors to be logged by Sentry as all errors are caught here.
How would I then manually log these errors?

  public async Task Invoke(Microsoft.AspNetCore.Http.HttpContext context /* other dependencies */)
    {
        try
        {
            await next(context);
        }
        catch (Exception ex)
        {
            await HandleExceptionAsync(context, ex);
        }
    }