是否可以快捷方式/绕过 WCF 中的其他 IErrorHandler?
我正在开发一个相当大的应用程序,并且想针对不同的情况以多种方式实现 IErrorHandler 。但是,似乎每个错误都会调用所有实例。有没有办法告诉 WCF 错误已由特定实例处理,以便列表中剩余的任何处理程序都不会被调用?
(更详细地说,我们正在使用添加“默认”错误处理程序的第 3 方工具包。这意味着无论我们做什么,都会调用该处理程序并撤销我们的一些更改。)
I am developing a rather large application and would like to implement IErrorHandler multiple ways for different conditions. However, it appears that ALL of the instances will be called for every error. Is there a way I can tell WCF that the error has been handled by a particular instance so that any handlers remaining in the list are not called?
(For a little more detail, we are using a 3rd party toolkit that adds a "default" error handler. This means that no matter what we do, this handler will be invoked and reverses some of our changes.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以只使用提供程序模式,并在其中包含错误处理程序的列表。然后,您可以将任何您喜欢的条件委托给您选择的处理程序。
也就是说,您将连接 1 个包含所有处理程序的错误处理程序,而不是连接许多按顺序执行的错误处理程序。
You could just use a provider pattern and inside it have a list of your error handlers. You could then have whatever condition you like to delegate to the handler of your choice.
Ie you would hook up 1 error handler that contains all your handlers instead of hooking up many which all get executed sequentially.