Skip to content

Commit 6dd018e

Browse files
committed
Add exception on wrong credentials instead of "DTD are not supported by SOAP" exception
1 parent e387f7e commit 6dd018e

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

src/Api/DataBoxSearch.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,22 @@
22

33
namespace Defr\CzechDataBox\Api;
44

5+
use Defr\CzechDataBox\DataBoxException;
6+
57
class DataBoxSearch extends \SoapClient
68
{
79

10+
public function __doRequest($request, $location, $action, $version, $oneWay = false)
11+
{
12+
$response = parent::__doRequest($request, $location, $action, $version, $oneWay);
13+
14+
if (false !== strpos($response, 'Authentication required!')) {
15+
throw new DataBoxException('Authentication required, check your credentials.');
16+
}
17+
18+
return $response;
19+
}
20+
821
/**
922
* @var array $classmap The defined classes
1023
*/

0 commit comments

Comments
 (0)