001 package org.LiveGraph.events; 002 003 import java.io.PrintStream; 004 import java.io.PrintWriter; 005 006 public class UncheckedEventProcessingException extends RuntimeException { 007 008 public UncheckedEventProcessingException(EventProcessingException actualException) { 009 super(actualException); 010 } 011 012 @Override 013 public EventProcessingException getCause() { 014 return (EventProcessingException) super.getCause(); 015 } 016 017 @Override 018 public synchronized String getLocalizedMessage() { 019 return "Actual exception: " + getCause().getLocalizedMessage(); 020 } 021 022 @Override 023 public synchronized void printStackTrace(PrintWriter s) { 024 synchronized (s) { 025 s.println(this); 026 StackTraceElement[] trace = getStackTrace(); 027 for (int i = 0; i < trace.length; i++) 028 s.println("\tat " + trace[i]); 029 s.flush(); 030 031 s.print("Acual exception: "); 032 getCause().printStackTrace(s); 033 s.flush(); 034 } 035 } 036 037 @Override 038 public synchronized void printStackTrace(PrintStream s) { 039 PrintWriter out = new PrintWriter(s); 040 printStackTrace(out); 041 } 042 043 }