Skip to content

Commit c902635

Browse files
authored
Add exception on wrong credentials instead of "DTD are not supported … (#19)
* Add exception on wrong credentials instead of "DTD are not supported by SOAP" exception * Add #[\ReturnTypeWillChange]
1 parent e387f7e commit c902635

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/Api/DataBoxSearch.php

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

33
namespace Defr\CzechDataBox\Api;
44

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

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

0 commit comments

Comments
 (0)