Author: max.andersen(a)jboss.com
Date: 2007-10-31 12:36:44 -0400 (Wed, 31 Oct 2007)
New Revision: 4598
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/BasicWorkbenchAdapter.java
Log:
JBIDE-618: bad exception dialog when cfg.xml not found
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/BasicWorkbenchAdapter.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/BasicWorkbenchAdapter.java 2007-10-31
16:04:44 UTC (rev 4597)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/BasicWorkbenchAdapter.java 2007-10-31
16:36:44 UTC (rev 4598)
@@ -95,18 +95,27 @@
collector.add(getChildren(object, monitor), monitor);
collector.done();
} catch(Exception e) {
- handleError(collector,e);
+ handleError(collector,object, e);
} finally {
collector.done();
monitor.done();
}
}
- protected void handleError(IElementCollector collector, Exception e) {
+ protected void handleError(IElementCollector collector, Object object, Exception e) {
HibernateConsolePlugin.getDefault().logMessage(IStatus.WARNING, e.toString(), e);
- HibernateConsolePlugin.openError(null, "Lazy tree error", "Error while
fetching children", e, HibernateConsolePlugin.PERFORM_SYNC_EXEC);
+ HibernateConsolePlugin.openError(null, getDefaultErrorTitle(),
getDefaultErrorMessage(object), e, HibernateConsolePlugin.PERFORM_SYNC_EXEC);
}
+ private String getDefaultErrorMessage(Object object) {
+ return "Error while expanding " + getLabel(object);
+ }
+
+
+ private String getDefaultErrorTitle() {
+ return "Hibernate Configuration error";
+ }
+
public boolean isContainer() {
return true;
}
Show replies by date