If your code assumes that a particular exception must be an IOError, take advantage of the language's precision, and say so.
如果您的代码假设某个特定的异常一定是一个IOError,那么利用该语言的精确性,就这么说。
If process 's implementation left it with a fault that resulted in a ValueError, for instance, rather than an IOError, the last handler above would at least report out ValueError as that class name.
举例来说,如果process的实现产生了一个导致ValueError而不是IOError的错误,上面最后一个处理程序至少会将ValueError作为类名报告上来。
If process 's implementation left it with a fault that resulted in a ValueError, for instance, rather than an IOError, the last handler above would at least report out ValueError as that class name.
举例来说,如果process的实现产生了一个导致ValueError而不是IOError的错误,上面最后一个处理程序至少会将ValueError作为类名报告上来。
应用推荐