Skip to content
Snippets Groups Projects
Commit 39d1744a authored by Iustin Pop's avatar Iustin Pop
Browse files

Fix usage of errors.ResolverError


This exception is documented to have three arguments, but in one case
we raise it with a simple string argument. Let's fix that.

Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 012f9bc3
No related branches found
No related tags found
No related merge requests found
...@@ -229,7 +229,12 @@ class Hostname: ...@@ -229,7 +229,12 @@ class Hostname:
try: try:
return result[0][4][0] return result[0][4][0]
except IndexError, err: except IndexError, err:
raise errors.ResolverError("Unknown error in getaddrinfo(): %s" % err) # we don't have here an actual error code, it's just that the
# data type returned by getaddrinfo is not what we expected;
# let's keep the same format in the exception arguments with a
# dummy error code
raise errors.ResolverError(hostname, 0,
"Unknown error in getaddrinfo(): %s" % err)
@classmethod @classmethod
def GetNormalizedName(cls, hostname): def GetNormalizedName(cls, hostname):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment