1 11 package org.eclipse.core.runtime; 12 13 import java.io.PrintStream ; 14 import java.io.PrintWriter ; 15 16 26 public class CoreException extends Exception { 27 28 31 private static final long serialVersionUID = 1L; 32 33 34 private IStatus status; 35 36 42 public CoreException(IStatus status) { 43 super(status.getMessage()); 44 this.status = status; 45 } 46 47 52 public final IStatus getStatus() { 53 return status; 54 } 55 56 61 public void printStackTrace() { 62 printStackTrace(System.err); 63 } 64 65 72 public void printStackTrace(PrintStream output) { 73 synchronized (output) { 74 super.printStackTrace(output); 75 if (status.getException() != null) { 76 output.print(getClass().getName() + "[" + status.getCode() + "]: "); status.getException().printStackTrace(output); 78 } 79 } 80 } 81 82 89 public void printStackTrace(PrintWriter output) { 90 synchronized (output) { 91 super.printStackTrace(output); 92 if (status.getException() != null) { 93 output.print(getClass().getName() + "[" + status.getCode() + "]: "); status.getException().printStackTrace(output); 95 } 96 } 97 } 98 99 } 100 | Popular Tags |