1 23 24 package org.objectweb.medor.api; 25 26 import java.io.PrintStream ; 27 import java.io.PrintWriter ; 28 29 35 public class MedorException extends Exception { 36 37 Exception inner = null; 38 39 public MedorException(String s) { 40 super(s); 41 } 42 43 public MedorException(Exception e) { 44 super("Nested Exception"); 45 inner = e; 46 } 47 48 public MedorException(String m, Exception e) { 49 super(m); 50 inner = e; 51 } 52 53 public Exception getNestedException() { 54 return inner; 55 } 56 57 public void printStackTrace() { 58 printStackTrace(System.out); 59 } 60 61 public void printStackTrace(PrintWriter pw) { 62 if (inner!=null) { 63 pw.println(super.getMessage()); 64 inner.printStackTrace(pw); 65 } 66 else { 67 super.printStackTrace(pw); 68 } 69 } 70 public void printStackTrace(PrintStream ps) { 71 if (inner!=null) { 72 ps.println(super.getMessage()); 73 inner.printStackTrace(ps); 74 } 75 else { 76 super.printStackTrace(ps); 77 } 78 } 79 80 81 } 82 | Popular Tags |