public async Task Invoke(HttpContext context) { try { await _next(context); await _customlogger.LogResponse(context); } catch (Exception ex) when(ex.Source == System.Reflection.Assembly.GetExecutingAssembly().GetName().Name) { _logger.LogError($"ERROR - MiddlewareOne() - {ex.ToString()}"); throw ex; } }