1 5 11 package com.opensymphony.workflow; 12 13 import java.io.PrintStream ; 14 import java.io.PrintWriter ; 15 16 17 22 public class InternalWorkflowException extends RuntimeException { 23 25 private Throwable rootCause; 26 27 29 public InternalWorkflowException() { 30 } 31 32 public InternalWorkflowException(String s) { 33 super(s); 34 } 35 36 public InternalWorkflowException(String s, Throwable rootCause) { 37 super(s); 38 this.rootCause = rootCause; 39 } 40 41 public InternalWorkflowException(Throwable rootCause) { 42 this.rootCause = rootCause; 43 } 44 45 47 public Throwable getRootCause() { 48 return rootCause; 49 } 50 51 public void printStackTrace() { 52 super.printStackTrace(); 53 54 if (rootCause != null) { 55 synchronized (System.err) { 56 System.err.println("\nRoot cause:"); 57 rootCause.printStackTrace(); 58 } 59 } 60 } 61 62 public void printStackTrace(PrintStream s) { 63 super.printStackTrace(s); 64 65 if (rootCause != null) { 66 synchronized (s) { 67 s.println("\nRoot cause:"); 68 rootCause.printStackTrace(s); 69 } 70 } 71 } 72 73 public void printStackTrace(PrintWriter s) { 74 super.printStackTrace(s); 75 76 if (rootCause != null) { 77 synchronized (s) { 78 s.println("\nRoot cause:"); 79 rootCause.printStackTrace(s); 80 } 81 } 82 } 83 } 84 | Popular Tags |