1 17 package org.eclipse.emf.codegen.jet; 18 19 20 import org.eclipse.core.runtime.CoreException; 21 import org.eclipse.core.runtime.IStatus; 22 import org.eclipse.core.runtime.Status; 23 24 import org.eclipse.emf.codegen.CodeGenPlugin; 25 26 27 28 32 public class JETException extends CoreException 33 { 34 public JETException(String reason) 35 { 36 super(new Status(IStatus.ERROR, CodeGenPlugin.INSTANCE.getSymbolicName(), 0, reason, null)); 37 } 38 39 42 public JETException (String reason, Throwable exception) 43 { 44 super(new Status(IStatus.ERROR, CodeGenPlugin.INSTANCE.getSymbolicName(), 0, reason, exception)); 45 } 46 47 50 public JETException (Throwable exception) 51 { 52 super 53 (new Status 54 (IStatus.ERROR, CodeGenPlugin.INSTANCE.getSymbolicName(), 0, getMessage(exception), exception)); 55 } 56 57 protected static String getMessage(Throwable exception) 58 { 59 String result = exception.getLocalizedMessage(); 60 if (result == null) 61 { 62 result = ""; 63 } 64 65 return result; 66 } 67 } 68 | Popular Tags |