diff --git a/src/Exception/EmptySoapResponseException.php b/src/Exception/EmptySoapResponseException.php new file mode 100644 index 00000000..9b9cd3ff --- /dev/null +++ b/src/Exception/EmptySoapResponseException.php @@ -0,0 +1,12 @@ +getMessage()); } + if ($this->soaperror_code === CURLE_OPERATION_TIMEDOUT) { + throw TimeoutException::timeoutFault( + "Timeout na comunicação com a SEFAZ [$url]: {$this->soaperror}", + CURLE_OPERATION_TIMEDOUT + ); + } if ($this->soaperror != '') { if ((int)$this->soaperror_code == 0) { $this->soaperror_code = 7; @@ -143,10 +155,10 @@ public function send( } elseif ((int) $httpcode == 500) { $httpcode = 89; } - throw SoapException::soapFault($msg, $httpcode); + throw UnexpectedHttpStatusException::soapFault($msg, $httpcode); } if (empty($this->responseBody)) { - throw SoapException::soapFault('Retorno da SEFAZ VAZIO', 99); + throw EmptySoapResponseException::soapFault('Retorno da SEFAZ VAZIO', 99); } if (!Validator::isXML($this->responseBody)) { throw SoapException::soapFault('O retorno não é um XML ' . $this->responseBody, 99);