Index: Zend_Framework/library/Zend/Amf/Server.php
===================================================================
--- Zend_Framework/library/Zend/Amf/Server.php	(Revision 15557)
+++ Zend_Framework/library/Zend/Amf/Server.php	(Arbeitskopie)
@@ -64,6 +64,12 @@
      * @var bool Production flag; whether or not to return exception messages
      */
     protected $_production = true;
+    
+    /**
+     * exception handler, which gets called on every exception thrown in a service
+     * @var callback
+     */
+    protected $_exceptionHandler;
 
     /**
      * Request processed
@@ -112,6 +118,20 @@
         $this->_production = (bool) $flag;
         return $this;
     }
+    
+	/**
+     * Sets the exception handler.
+     * This gets called, when a exception is thrown inside a service.
+     *
+     * @param  callback $handler This must be a function expecting an exception as the only parameter.
+     * @return the old exception handler
+     */
+    public function setExceptionHandler($handler)
+    {
+    	$old = $this->_exceptionHandler;
+        $this->_exceptionHandler = $handler;
+        return $old;
+    }
 
     /**
      * Whether or not the server is in production
@@ -315,6 +335,10 @@
                 }
                 $responseType = Zend_AMF_Constants::RESULT_METHOD;
             } catch (Exception $e) {
+            	if(is_callable($this->_exceptionHandler)){
+            		call_user_func($this->_exceptionHandler, $e);
+            	}
+            	
                 switch ($objectEncoding) {
                     case Zend_Amf_Constants::AMF0_OBJECT_ENCODING :
                         $return = array(

