1 11 package org.eclipse.jdt.internal.core.builder; 12 13 import org.eclipse.core.runtime.*; 14 15 19 public class ImageBuilderInternalException extends RuntimeException { 20 21 private static final long serialVersionUID = 28252254530437336L; protected CoreException coreException; 23 24 public ImageBuilderInternalException(CoreException e) { 25 this.coreException = e; 26 } 27 28 public String getLocalizedMessage() { 29 IStatus status = this.coreException.getStatus(); 30 if (status.isMultiStatus()) { 31 IStatus[] children = status.getChildren(); 32 if (children != null && children.length > 0) 33 return children[0].getMessage(); 34 } 35 return this.coreException.getLocalizedMessage(); 36 } 37 38 public CoreException getThrowable() { 39 return coreException; 40 } 41 42 public void printStackTrace() { 43 if (coreException != null) { 44 System.err.println(this); 45 System.err.println("Stack trace of embedded core exception:"); coreException.printStackTrace(); 47 } else { 48 super.printStackTrace(); 49 } 50 } 51 } 52 | Popular Tags |