1 31 package org.objectweb.proactive.core; 32 33 41 public class ProActiveException extends Exception { 42 43 public Throwable detail; 44 45 49 public ProActiveException() {} 50 51 55 public ProActiveException(String s) { 56 super(s); 57 } 58 59 65 public ProActiveException(String s, Throwable ex) { 66 super(s); 67 detail = ex; 68 } 69 70 71 76 public ProActiveException(Throwable ex) { 77 super(); 78 detail = ex; 79 } 80 81 82 86 public Throwable getTargetException() { 87 return detail; 88 } 89 90 91 95 public String getMessage() { 96 if (detail == null) 97 return super.getMessage(); 98 else { 99 if (super.getMessage() == null) 100 return detail.getMessage(); 101 else return super.getMessage() + "; nested exception is: \n" + detail.toString(); 102 } 103 } 104 105 110 public void printStackTrace(java.io.PrintStream ps) { 111 if (detail == null) { 112 super.printStackTrace(ps); 113 } else { 114 synchronized(ps) { 115 ps.println(getMessage()); 116 detail.printStackTrace(ps); 117 } 118 } 119 } 120 121 124 public void printStackTrace() { 125 printStackTrace(System.err); 126 } 127 128 133 public void printStackTrace(java.io.PrintWriter pw) { 134 if (detail == null) { 135 super.printStackTrace(pw); 136 } else { 137 synchronized(pw) { 138 pw.println(getMessage()); 139 detail.printStackTrace(pw); 140 } 141 } 142 } 143 144 } 145 | Popular Tags |