e = e.getCause();
}
// UnableToCompleteException
if ("com.google.gwt.core.ext.UnableToCompleteException".equals(e.getClass().getName())) {
String messages = GwtState.getLoggerErrorMessages();
return new DesignerException(HostedModeException.MODULE_LOADING_ERROR2,
e,
new String[]{messages});
}
// HostedModeException
if (e instanceof HostedModeException) {
HostedModeException hme = (HostedModeException) e;
return new DesignerException(hme.getCode(), e.getCause(), hme.getParameters());
}
// NPE in com.google.gwt.dev.javac.CompiledClass.<init>
if (e instanceof NullPointerException) {
StackTraceElement element = e.getStackTrace()[0];
if (element.getClassName().equals("com.google.gwt.dev.javac.CompiledClass")
&& element.getMethodName().equals("<init>")
|| System.getProperty("wbp.GWT_ExceptionRewriter.simulate.CompiledClass") != null) {
return new DesignerException(IExceptionConstants.NPE_IN_COMPILED_CLASS, e);
}
}
// IncompatibleClassChangeError for GWT 2.2
{
Throwable rootException = DesignerExceptionUtils.getRootCause(e);
if (rootException instanceof IncompatibleClassChangeError) {
String message = rootException.getMessage();
if (message != null && message.contains("com.google.gwt.core.ext.typeinfo.JClassType")) {
return new DesignerException(IExceptionConstants.BINARY_INCOMPAT_GWT22, e);
}
}
}
// use as is
return e;