私は次のように独自の動作を作成しました。
public class BoundaryExceptionHandlingBehavior : IInterceptionBehavior
{
public IEnumerable<Type> GetRequiredInterfaces()
{
return Type.EmptyTypes;
}
public IMethodReturn Invoke(IMethodInvocation input, GetNextInterceptionBehaviorDelegate getNext)
{
try
{
return getNext()(input, getNext);
}
catch (Exception ex)
{
return null; //this would be something else...
}
}
public bool WillExecute
{
get { return true; }
}
}
動作が期待どおりにヒットするように、正しく設定されています。ただし、getNext()で例外が発生しても、catchブロックにはヒットしません。誰かが理由を明確にできますか?例外に対処する方法はたくさんあるので、私は実際には問題を解決しようとは思っていません。何が起こっているのかわからないというだけでなく、やりたいと思っています。