Small cleanups / changes amassed over time
- Small javadoc fixes - Simplifications - Move logException method from StringUtils to ExceptionUtils
This commit is contained in:
@@ -33,4 +33,14 @@ public final class ExceptionUtils {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Format the information from a Throwable as string, retaining the type and its message.
|
||||
*
|
||||
* @param th the throwable to process
|
||||
* @return string with the type of the Throwable and its message, e.g. "[IOException]: Could not open stream"
|
||||
*/
|
||||
public static String formatException(Throwable th) {
|
||||
return "[" + th.getClass().getSimpleName() + "]: " + th.getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user