子アクションで例外を飲み込むことが多いようです。
[ChildActionOnly]
[OutputCache(Duration = 1200, VaryByParam = "key;param")]
public ActionResult ChildPart(int key, string param)
{
try
{
var model = DoRiskyExceptionProneThing(key, param)
return View("_ChildPart", model);
}
catch (Exception ex)
{
// Log to elmah using a helper method
ErrorLog.LogError(ex, "Child Action Error ");
// return a pretty bit of HTML to avoid a whitescreen of death on the client
return View("_ChildActionOnlyError");
}
}
コードの山を切り貼りしているように感じます。切り貼りするたびに、子猫が天使の涙に溺れていることがわかります。
画面の残りの部分を適切にレンダリングできるようにする、子アクションの例外を管理するより良い方法はありますか?