1 package org.sapia.ubik.rmi; 2 3 import java.io.PrintStream ; 4 import java.io.PrintWriter ; 5 6 7 15 public class RemoteRuntimeException extends RuntimeException { 16 17 private Throwable _theSourceError; 18 19 25 public RemoteRuntimeException(String aMessage, Throwable aSourceError) { 26 super(aMessage); 27 _theSourceError = aSourceError; 28 } 29 30 35 public RemoteRuntimeException(String aMessage) { 36 super(aMessage); 37 } 38 39 43 48 public Throwable getSourceError() { 49 return _theSourceError; 50 } 51 52 56 59 public void printStackTrace() { 60 printStackTrace(System.err); 61 } 62 63 66 public void printStackTrace(PrintWriter anOutput) { 67 super.printStackTrace(anOutput); 68 69 if (_theSourceError != null) { 70 anOutput.print("\n---> NESTED EXCEPTION IS: "); 71 _theSourceError.printStackTrace(anOutput); 72 } 73 } 74 75 78 public void printStackTrace(PrintStream anOutput) { 79 super.printStackTrace(anOutput); 80 81 if (_theSourceError != null) { 82 anOutput.print("\n---> NESTED EXCEPTION IS: "); 83 _theSourceError.printStackTrace(anOutput); 84 } 85 } 86 } 87 | Popular Tags |