如何处理ArgumentException? [英] how to handle ArgumentException?
本文介绍了如何处理ArgumentException?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试设计一个soap扩展类来处理我的webservice应用程序中的所有异常,但是我无法获得system.ArgumentException,因为所有异常都打包到SoapException。我可以在ProcessMessage中做什么,或者有另一个条目来处理异常,谢谢。
i am trying to design a soap extension class to process all exception in my webservice app, but i can't get the system.ArgumentException,because all exception are pack to SoapException. what can i do in ProcessMessage or there is another entry to handle the Exception, thank you.
推荐答案
查看InnerException以查看原始异常是否存在。否则,您可能只是运气不好,需要在所有Web方法周围放置try / catch块。
在WCF中这更容易。
Look in the InnerException to see if the original exception is there. Otherwise, you may just be out of luck and need to put try/catch blocks around all of your web methods.
This is much easier in WCF.
这篇关于如何处理ArgumentException?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文