title: Global exception hadling .net core doesnt work
body: <p>I try to apply global exeption handling in project. I think that I have everything set properly:</p>
  
  <p>Middleware:</p>
  
  <pre><code>if (env.IsDevelopment())
  {
    app.UseDeveloperExceptionPage();
  }
  else
  {
    app.UseExceptionHandler("/Error");
    app.UseStatusCodePagesWithRedirects("/Error/{0}");
  }
  </code></pre>
  
  <p>ErrorController:</p>
  
  <pre><code>[AllowAnonymous] 
  [Route("Error")] 
  public IActionResult Error() 
  {returnView("Error");}
  </code></pre>
  
  <p>View is set as well. </p>
  
  <p>I try to throw new Exception("message") in controllers, middleware, models but everytime my app falls down with message unhandled exception. In Launch setting is set Production. Even is Development I cannot see DeveloperExceptionPage... But during the writing code when some error appaered DeveloperExceptionPage worked well...</p>
  
  <p>Thank you in advance for helping.</p>
  
  <p>D.</p>