Skip to content

Commit

Permalink
using IsDevelopmen, throw new Exception("Hello exception"); in App.Ru…
Browse files Browse the repository at this point in the history
…n() and t to see de execption result
  • Loading branch information
fMATSINHE committed Jan 4, 2020
1 parent a096e82 commit 33cac24
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Helloword_core/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,16 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
}

app.Map("/test", testPipeline);
app.Use(next => async context =>
{
await context.Response.WriteAsync("Before Hello: ");
await next.Invoke(context);
});
// app.Use(next => async context =>
//{
// await context.Response.WriteAsync("Before Hello: ");
// await next.Invoke(context);
//});

app.Run(async (context) =>
{
throw new Exception("Hello exception");
await context.Response.WriteAsync("hello word");
});
}
Expand Down

0 comments on commit 33cac24

Please sign in to comment.