Your exception hierarchy should begin with something fairly robust and generic, like ApplicationException.
异常层次结构应该从一些十分健壮而又通用的异常入手,如ApplicationException。
The answer is to provide a more useful type of exception that also contains a lower-level exception. Listing 1 shows a simple ApplicationException that does just this
答案是提供一类更有用的异常,它还包含低级异常。
First, the program did not hit the catch clause for an exception of type ApplicationException, even though that's the type of exception thrown from the static constructor.
第一,该程序不会为类型是ApplicationException的异常寻找catch子句,即使这种类型的异常是从静态构造函数引发的也如此。
应用推荐