This is seriously underused. Most public APIs don't have @throws Java documentation to explain the exceptions thrown.
This is a good example.
... * * @throws MalformedURLException The formal system identifier of a * subordinate catalog cannot be turned into a valid URL. * @throws IOException Error reading subordinate catalog file. */ public String resolveSystem(String systemId) throws MalformedURLException, IOException { ...
This is a bad example of a lack of information about under what circumstances an exception is thrown.
* @throws Exception exception */ public void startServer() throws Exception { if (!externalDatabaseHost) {
The above is the detailed content of How to log all exceptions thrown by a method in Java?. For more information, please follow other related articles on the PHP Chinese website!