From 56de475f113f73049a67bc6118f3667a21bf1dc3 Mon Sep 17 00:00:00 2001 From: ebanks Date: Sun, 25 Jul 2010 03:57:44 +0000 Subject: [PATCH] Based on feedback from non-GSA users, who claim that our exceptions are 'scary and overwhelming,' I've cleaned up the error message to first describe the error and what users should do and then ask them to copy the subsequent stack trace into their GetSatisfaction posting. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3874 348d0f76-0448-11de-a6fe-93d51630548a --- .../sting/commandline/CommandLineProgram.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/java/src/org/broadinstitute/sting/commandline/CommandLineProgram.java b/java/src/org/broadinstitute/sting/commandline/CommandLineProgram.java index ef25f5993..2b7cf3065 100644 --- a/java/src/org/broadinstitute/sting/commandline/CommandLineProgram.java +++ b/java/src/org/broadinstitute/sting/commandline/CommandLineProgram.java @@ -248,7 +248,7 @@ public abstract class CommandLineProgram { catch (Exception e) { // we catch all exceptions here. if it makes it to this level, we're in trouble. Let's bail! // TODO: what if the logger is the exception? hmm... - logger.fatal("Exception caught by base Command Line Program. Stack trace is as follows:"); + logger.fatal("\n"); toErrorLog(clp, e); throw new RuntimeException(e); } @@ -324,12 +324,14 @@ public abstract class CommandLineProgram { * @param msg */ private static void printExitSystemMsg(final String msg) { - System.out.printf("------------------------------------------------------------------------------------------%n"); System.out.printf("The following error has occurred:%n%n"); System.out.printf("%s:%n%n", msg); System.out.printf("Please check your command line arguments for any typos or inconsistencies.%n"); - System.out.printf("Please review our general documentation at http://www.broadinstitute.org/gsa/wiki or contact us via our%n"); - System.out.printf("support site at http://getsatisfaction.com/gsa to report bugs or get help resolving undocumented issues%n"); + System.out.printf("Also please review our documentation at:%n"); + System.out.printf(" http://www.broadinstitute.org/gsa/wiki %n%n"); + System.out.printf("To report bugs or to get help resolving undocumented issues, please contact us via our support site at%n"); + System.out.printf(" http://getsatisfaction.com/gsa %n%n"); + System.out.printf("Please be sure to include the stack trace below when posting a message on the support site:%n"); } /** @@ -372,8 +374,11 @@ public abstract class CommandLineProgram { * @param e the error */ public static void exitSystemWithError(final String msg, Exception e) { - e.printStackTrace(); + System.out.printf("------------------------------------------------------------------------------------------%n"); printExitSystemMsg(msg); + System.out.printf("------------------------------------------------------------------------------------------%n"); + e.printStackTrace(); + System.out.printf("------------------------------------------------------------------------------------------%n"); System.exit(1); }