Skip to content

Commit fb16689

Browse files
committed
Pass along InvalidXmlException instead of re-throwing a new one
1 parent 0f4117b commit fb16689

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/Response.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,10 @@ class Response implements ResponseInterface {
3333
*/
3434
public function __construct($text, &$client = null)
3535
{
36-
$this->rawResponse = $text;
37-
try {
38-
$doc = new QuiteSimpleXMLElement($text);
39-
} catch (\Exception $e) {
40-
throw new \Exception('Invalid XML received');
41-
}
36+
$this->rawResponse = $text;
37+
38+
// Throws Danmichaelo\QuiteSimpleXMLElement\InvalidXMLException on invalid xml
39+
$this->response = new QuiteSimpleXMLElement($text);
4240

4341
$this->client = $client;
4442

0 commit comments

Comments
 (0)