mirror of
https://github.com/danog/dns.git
synced 2024-11-26 20:14:51 +01:00
Improve warning if config loading fails
This commit is contained in:
parent
299511d7e6
commit
659bad6bba
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,4 +3,5 @@ composer.lock
|
||||
phpunit.xml
|
||||
vendor
|
||||
.php_cs.cache
|
||||
.phpunit.result.cache
|
||||
coverage
|
||||
|
@ -187,7 +187,11 @@ final class Rfc1035StubResolver implements Resolver
|
||||
throw $reason;
|
||||
}
|
||||
|
||||
if ($searchIndex < \count($searchList) - 1 && \in_array($reason->getCode(), [2, 3], true)) {
|
||||
if ($searchIndex < \count($searchList) - 1 && \in_array(
|
||||
$reason->getCode(),
|
||||
[2, 3],
|
||||
true
|
||||
)) {
|
||||
continue 2;
|
||||
}
|
||||
|
||||
@ -246,15 +250,19 @@ final class Rfc1035StubResolver implements Resolver
|
||||
} catch (ConfigException $e) {
|
||||
$this->configStatus = self::CONFIG_FAILED;
|
||||
|
||||
$message = "Could not load the system's DNS configuration; "
|
||||
. "falling back to synchronous, blocking resolver; "
|
||||
. \get_class($e) . ": " . $e->getMessage();
|
||||
|
||||
try {
|
||||
\trigger_error(
|
||||
"Could not load the system's DNS configuration, using synchronous, blocking fallback",
|
||||
$message,
|
||||
\E_USER_WARNING
|
||||
);
|
||||
} catch (\Throwable $triggerException) {
|
||||
\set_error_handler(null);
|
||||
\trigger_error(
|
||||
"Could not load the system's DNS configuration, using synchronous, blocking fallback",
|
||||
$message,
|
||||
\E_USER_WARNING
|
||||
);
|
||||
\restore_error_handler();
|
||||
|
Loading…
Reference in New Issue
Block a user