 +     */
 +    public function setup($request, $context) {
 +      $peer= $this->wrapper->getPeer();
-+      $entity= $this->getEntity($peer, $request, $context);
++
++      try {
++        $entity= $this->getEntity($peer, $request, $context);
++      } catch (SQLStatementFailedException $e) {
++        return $this->addError('sql+stmt:'.$e->getErrorcode(), '*', $e->getMessage());
++      } catch (SQLException $e) {
++        return $this->addError('sql+generic:'.$e->getClassName(), '*', $e->getMessage());
++      } catch (NoSuchElementException $e) {
++        return $this->addError('notfound', '*', $e->getMessage());
++      } catch (IllegalAccessException $e) {
++        return $this->addError('access', '*', $e->getMessage());
++      }
 +      
 +      // Set formvalues
 +      foreach (array_keys($peer->types) as $field) {

===================================================================
--- facade/dataset/FieldTypeMap.class.php	(revision 0)
+++ facade/dataset/FieldTypeMap.class.php	(revision 0)
@@ -0,0 +1,89 @@
+<?php
+/* This class is part of the XP framework
+ *

+  class EditDataSetHandler extends DataSetHandler {
+
+    /**
+     * Retrieve the entity by its primary key
+     *
+     * @param   rdbms.Peer
+     * @param   scriptlet.xml.workflow.WorkflowScriptletRequest request 
