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