for(File f : files){
try {
process(f); // may throw various exceptions
} catch (Exception e) {
logger.error(e.getMessage(), e);
}
}
More Related Contents:
- Causes of getting a java.lang.VerifyError
- How to use wait and notify in Java without IllegalMonitorStateException?
- Concurrent Modification Exception : adding to an ArrayList
- Should a retrieval method return ‘null’ or throw an exception when it can’t produce the return value? [closed]
- java.rmi.ServerException: RemoteException occurred in server thread (ClassNotFoundException)
- Can I catch multiple Java exceptions in the same catch clause?
- Differences between Exception and Error
- What could cause java.lang.reflect.InvocationTargetException?
- Why doesn’t Java allow to throw a checked exception from static initialization block?
- (Unknown Source) in Exception stack trace
- Java / Android – How to print out a full stack trace?
- tomcat server fails to start the server and application in STS [duplicate]
- Difference between using Throwable and Exception in a try catch [duplicate]
- Eclipse – java.lang.ClassNotFoundException
- What throws an IOException in Java?
- When should an IllegalArgumentException be thrown?
- Can we use “return” in finally block [duplicate]
- PrintWriter and PrintStream never throw IOExceptions
- Rethrowing exceptions in Java without losing the stack trace
- Java uncaught global exception handler
- Unhandled Exception in Java
- How can I catch Event Dispatch Thread (EDT) exceptions?
- Why am I getting “must be caught or declared to be thrown” on my program?
- JavaFX Exception in thread “main” java.lang.NoClassDefFoundError: javafx/application/Application
- throws Exception in finally blocks
- In Java, is using throws Exception instead of throwing multiple specific exceptions good practice?
- When to log a stacktrace for a caught exception
- Should methods that throw RuntimeException indicate it in method signature?
- Unable to run JUnit test with PowerMockRunner
- maximum size of java class / exception table