It is still advisable that you catch all exceptions and handle them appropriately, as shown in the following code.
如下面的代码所示,发现所有的异常并正确的处理他们仍是明智之举。
2
As an alternative, you can catch this exception directly in your code and handle it some other way (perhaps printing out the actual error message along with usage information, for instance).
You still need to handle this exception of course, but writing a catch block to handle a detected error is much simpler than writing code to detect all possible errors.