1 package org.sapia.util; 2 3 4 import java.io.PrintStream ; 7 import java.io.PrintWriter ; 8 9 10 21 public class ApplicationStarterException extends Exception { 22 26 27 private Throwable _theSourceError; 28 29 33 39 public ApplicationStarterException(String aMessage, Throwable aSourceError) { 40 super(aMessage); 41 _theSourceError = aSourceError; 42 } 43 44 48 53 public Throwable getSourceError() { 54 return _theSourceError; 55 } 56 57 61 64 public void printStackTrace() { 65 printStackTrace(System.err); 66 } 67 68 71 public void printStackTrace(PrintWriter anOutput) { 72 super.printStackTrace(anOutput); 73 74 if (_theSourceError != null) { 75 anOutput.print("\n---> NESTED EXCEPTION IS: "); 76 _theSourceError.printStackTrace(anOutput); 77 } 78 } 79 80 83 public void printStackTrace(PrintStream anOutput) { 84 super.printStackTrace(anOutput); 85 86 if (_theSourceError != null) { 87 anOutput.print("\n---> NESTED EXCEPTION IS: "); 88 _theSourceError.printStackTrace(anOutput); 89 } 90 } 91 } 92 | Popular Tags |