Lisheng Sun created HADOOP-16431: ------------------------------------ Summary: Change Log Level to trace in IOUtils.java and ExceptionDiags.java Key: HADOOP-16431 URL: https://issues.apache.org/jira/browse/HADOOP-16431 Project: Hadoop Common Issue Type: Improvement Reporter: Lisheng Sun
When there is no String Constructor for the exception, we Log a Warn Message, and rethrow the exception. We can change the Log level to TRACE/DEBUG. {code:java} private static <T extends IOException> T wrapWithMessage( T exception, String msg) { Class<? extends Throwable> clazz = exception.getClass(); try { Constructor<? extends Throwable> ctor = clazz.getConstructor(String.class); Throwable t = ctor.newInstance(msg); return (T) (t.initCause(exception)); } catch (Throwable e) { LOG.trace("Unable to wrap exception of type " + clazz + ": it has no (String) constructor", e); return exception; } } {code} -- This message was sent by Atlassian JIRA (v7.6.14#76016) --------------------------------------------------------------------- To unsubscribe, e-mail: common-dev-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-dev-h...@hadoop.apache.org