diff options
author | Bob Halley <halley@dnspython.org> | 2021-10-25 18:04:56 -0700 |
---|---|---|
committer | Bob Halley <halley@dnspython.org> | 2021-10-25 18:05:31 -0700 |
commit | ef9826268ee9b2112fe0f8f26eb90496de5d4158 (patch) | |
tree | 66d2c260a3562e086116603be97972adab87918a | |
parent | 99166c2c2915c594df5cbbb2fffa6075309ae703 (diff) | |
download | dnspython-ef9826268ee9b2112fe0f8f26eb90496de5d4158.tar.gz |
Distinguish between the two causes of NoResolverConfiguration in the exception string
-rw-r--r-- | dns/resolver.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/dns/resolver.py b/dns/resolver.py index 08e9e61..108dd52 100644 --- a/dns/resolver.py +++ b/dns/resolver.py @@ -807,7 +807,7 @@ class BaseResolver: f = stack.enter_context(open(f)) except OSError: # /etc/resolv.conf doesn't exist, can't be read, etc. - raise NoResolverConfiguration + raise NoResolverConfiguration(f'cannot open {f}') for l in f: if len(l) == 0 or l[0] == '#' or l[0] == ';': @@ -848,7 +848,7 @@ class BaseResolver: except (ValueError, IndexError): pass if len(self.nameservers) == 0: - raise NoResolverConfiguration + raise NoResolverConfiguration('no nameservers') def _determine_split_char(self, entry): # |