Description
org.apache.hadoop.hdfs.tools.AdminHelper has a method to prettifyExceptions:
static String prettifyException(Exception e) { return e.getClass().getSimpleName() + ": " + e.getLocalizedMessage().split("\n")[0]; }
But if e is a NPE the e.getLocalizedMessage() could be null. In that case NPE will be thrown and the original error message will be lost.