1 7 8 52 package com.lowagie.text; 53 54 58 public class ExceptionConverter extends RuntimeException { 59 private static final long serialVersionUID = 8657630363395849399L; 60 61 private Exception ex; 62 63 private String prefix; 64 65 69 public ExceptionConverter(Exception ex) { 70 this.ex = ex; 71 prefix = (ex instanceof RuntimeException ) ? "" : "ExceptionConverter: "; 72 } 73 74 78 public Exception getException() { 79 return ex; 80 } 81 82 86 public String getMessage() { 87 return ex.getMessage(); 88 } 89 90 94 public String getLocalizedMessage() { 95 return ex.getLocalizedMessage(); 96 } 97 98 102 public String toString() { 103 return prefix + ex; 104 } 105 106 107 public void printStackTrace() { 108 printStackTrace(System.err); 109 } 110 111 116 public void printStackTrace(java.io.PrintStream s) { 117 synchronized (s) { 118 s.print(prefix); 119 ex.printStackTrace(s); 120 } 121 } 122 123 127 public void printStackTrace(java.io.PrintWriter s) { 128 synchronized (s) { 129 s.print(prefix); 130 ex.printStackTrace(s); 131 } 132 } 133 134 140 public Throwable fillInStackTrace() { 141 return this; 142 } 143 } | Popular Tags |