title: How to handle errors with para in Asp Net Core?
body: <p>In the manual, it says I can redirect my page to an error page by:</p>
  
  <pre><code>app.UseExceptionHandler("/Error");
  </code></pre>
  
  <p>For example, in a controller class I wrote:</p>
  
  <pre><code>public IActionResult test(){
      throw new Exception("Some Para");
      var obj = new Dictionary&lt;string,string&gt;();
      return new ObjectResult(obj);
  }
  </code></pre>
  
  <p>As you can see, I did send para when I triggered the exception. <strong>But how could I get the para in my ErrorController</strong>? Now it looks like this:</p>
  
  <pre><code>public class ErrorController : Controller
  {
  
      //In the tutorial, this can be public static void HomePage(IApplicationBuilder app)
      //But failed when i tried
      [HttpGet]
      public IActionResult Index(){
          var obj = new Dictionary&lt;string,string&gt;();
          obj.Add("error","code");
          return new ObjectResult(obj);
      }
  }
  </code></pre>