Merge branch 'MDL-29435' of git://github.com/mouneyrac/moodle
authorSam Hemelryk <sam@moodle.com>
Mon, 17 Oct 2011 04:31:52 +0000 (17:31 +1300)
committerSam Hemelryk <sam@moodle.com>
Mon, 17 Oct 2011 04:31:52 +0000 (17:31 +1300)
1  2 
webservice/soap/locallib.php

@@@ -76,9 -113,14 +113,14 @@@ class webservice_soap_server extends we
              $this->zend_server->setReturnResponse(true);
              //TODO: the error handling in Zend Soap server is useless, XML-RPC is much, much better :-(
              $this->zend_server->registerFaultException('moodle_exception');
 -            $this->zend_server->registerFaultException('webservice_parameter_exception');
 +            $this->zend_server->registerFaultException('webservice_parameter_exception'); //deprecated since Moodle 2.2 - kept for backward compatibility
              $this->zend_server->registerFaultException('invalid_parameter_exception');
              $this->zend_server->registerFaultException('invalid_response_exception');
+             //when DEBUG >= NORMAL then the thrown exceptions are "casted" into a PHP SoapFault expception
+             //in order to diplay the $debuginfo (see moodle_zend_soap_server class - MDL-29435)
+             if (debugging()) {
+                 $this->zend_server->registerFaultException('SoapFault');
+             }
          }
      }