From 1baeaaac36b78c33bce80ed92c5c0f82a0e5aa11 Mon Sep 17 00:00:00 2001
From: Ben Adams <thundercat@illyriad.co.uk>
Date: Sat, 13 Apr 2019 01:40:16 +0100
Subject: [PATCH] Feedback

---
 .../src/Infrastructure/ResourceInvoker.cs      | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/ResourceInvoker.cs b/src/Mvc/Mvc.Core/src/Infrastructure/ResourceInvoker.cs
index 4f6a4f0f706..3c124ccefc4 100644
--- a/src/Mvc/Mvc.Core/src/Infrastructure/ResourceInvoker.cs
+++ b/src/Mvc/Mvc.Core/src/Infrastructure/ResourceInvoker.cs
@@ -67,20 +67,14 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure
             _actionContextAccessor.ActionContext = _actionContext;
             var scope = _logger.ActionScope(_actionContext.ActionDescriptor);
 
-            Exception invokeException = null;
             Task task = null;
             try
             {
                 task = InvokeFilterPipelineAsync();
             }
-            catch (Exception ex)
-            {
-                invokeException = ex;
-            }
-
-            if (invokeException != null)
+            catch (Exception exception)
             {
-                return Awaited(this, Task.FromException(invokeException), scope);
+                return Awaited(this, Task.FromException(exception), scope);
             }
 
             Debug.Assert(task != null);
@@ -94,9 +88,9 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure
             {
                 ReleaseResources();
             }
-            catch (Exception ex)
+            catch (Exception exception)
             {
-                releaseException = ex;
+                releaseException = exception;
             }
 
             Exception scopeException = null;
@@ -104,9 +98,9 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure
             {
                 scope.Dispose();
             }
-            catch (Exception ex)
+            catch (Exception exception)
             {
-                scopeException = ex;
+                scopeException = exception;
             }
 
             if (releaseException == null && scopeException == null)
-- 
GitLab