Intercept the call to an async method using DynamicProxy

后端 未结 8 1005
隐瞒了意图╮
隐瞒了意图╮ 2020-12-13 02:30

Below is the code from the Intercept method on a custom type that implements IInterceptor of the Castle Dynamic Proxy library. This snippet is from

8条回答
  •  感情败类
    2020-12-13 02:54

    Instead of:

    tcs2.SetException(x.Exception);
    

    You should use:

    x.Exception.Handle(ex => { tcs2.SetException(ex); return true; });
    

    to bubble up the real exception...

提交回复
热议问题