--- /dev/null
+package org.simantics.ui.workbench.handler;\r
+\r
+import org.eclipse.core.commands.AbstractHandler;\r
+import org.eclipse.core.commands.ExecutionEvent;\r
+import org.eclipse.core.commands.ExecutionException;\r
+import org.simantics.db.exception.DatabaseException;\r
+\r
+abstract public class AbstractDatabaseHandler extends AbstractHandler {\r
+\r
+ abstract public Object checkedExecute(ExecutionEvent event) throws ExecutionException, DatabaseException;\r
+ \r
+ @Override\r
+ final public Object execute(ExecutionEvent event) throws ExecutionException {\r
+ try {\r
+ return checkedExecute(event);\r
+ } catch (DatabaseException e) {\r
+ throw new ExecutionException("The handler caught an unhandled exception, ", e);\r
+ }\r
+ } \r
+ \r
+}\r