[SoapBundle] Enhanced SoapFault management

This commit is contained in:
Francis Besset
2013-12-13 08:26:18 +01:00
parent fd5154a469
commit 3a2b8e32ee
4 changed files with 68 additions and 6 deletions

View File

@ -23,6 +23,7 @@ class ExceptionHandler
{
protected $exception;
protected $details;
protected $soapFault;
public function __construct(FlattenException $exception, $details = null)
{
@ -30,8 +31,17 @@ class ExceptionHandler
$this->details = $details;
}
public function setSoapFault(\SoapFault $soapFault)
{
$this->soapFault = $soapFault;
}
public function __call($method, $arguments)
{
if (isset($this->soapFault)) {
throw $this->soapFault;
}
$code = $this->exception->getStatusCode();
throw new ReceiverSoapFault(