static void die(Exception e,
String type,
boolean debug) {
FaultHelper helper = null;
if (e != null) {
helper = new FaultHelper(FaultHelper.toBaseFault(e));
} else {
System.err.println("Error, but no exception");
}
if (helper != null) {
if (debug) {
System.err.println("\n------\nError:\n------\n");
System.err.println(type + ":\n" +
helper.getDescriptionAsString() + "\n");
System.err.println("\n-----------\nStacktrace:\n-----------\n");
FaultHelper.printStackTrace(e);
} else {
System.err.println("\n------\nError:\n------\n");
System.err.println();
System.err.println(type + ":\n" +
helper.getDescriptionAsString() + "\n");
}
}
System.exit(APPLICATION_ERROR);
}