【发布时间】:2011-05-30 00:06:50
【问题描述】:
我有这个...
public void FooAsync()
{
AsyncManager.OutstandingOperations.Increment();
Task.Factory.StartNew(() =>
{
try
{
doSomething.Start();
}
catch (Exception e)
{
AsyncManager.Parameters["exc"] = e;
}
finally
{
AsyncManager.OutstandingOperations.Decrement();
}
});
}
public ActionResult FooCompleted(Exception exc)
{
if (exc != null)
{
throw exc;
}
return View();
}
有没有更好的方法将异常传递回 ASP.net?
干杯,伊恩。
【问题讨论】:
标签: asp.net-mvc-3 exception-handling asynchronous