|
@@ -17,6 +17,9 @@
|
|
|
*/
|
|
|
package org.apache.hadoop.util;
|
|
|
|
|
|
+import java.io.PrintWriter;
|
|
|
+import java.io.StringWriter;
|
|
|
+
|
|
|
import org.apache.commons.logging.Log;
|
|
|
import org.apache.commons.logging.LogFactory;
|
|
|
import org.apache.hadoop.classification.InterfaceAudience;
|
|
@@ -101,7 +104,10 @@ public final class ExitUtil {
|
|
|
* @throws ExitException if System.exit is disabled for test purposes
|
|
|
*/
|
|
|
public static void terminate(int status, Throwable t) throws ExitException {
|
|
|
- terminate(status, t.getMessage());
|
|
|
+ StringWriter sw = new StringWriter();
|
|
|
+ t.printStackTrace(new PrintWriter(sw));
|
|
|
+ terminate(status, "Fatal exception with message " + t.getMessage() +
|
|
|
+ "\nstack trace\n" + sw.toString());
|
|
|
}
|
|
|
|
|
|
/**
|