Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions docker_dns.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@ def lookup_container(self, name):
except docker.client.APIError as ex:
# 404 is valid, others aren't
if ex.response.status_code != 404:
warn(ex)
warn(str(ex))

return None

except RequestException as ex:
warn(ex)
warn(str(ex))
return None

def get_a(self, name):
Expand Down Expand Up @@ -197,7 +197,10 @@ def lookupAddress(self, name, timeout=None):

# We need to catch everything. Uncaught exceptian will make the server
# stop responding
except: # pylint:disable=bare-except
except Exception, e: # pylint:disable=bare-except
if type(e) != DomainError:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if isinstance(e, DomainError): would be better

import traceback
traceback.print_exc()
if CONFIG['no_nxdomain']:
# FIXME surely there's a better way to give SERVFAIL
exception = DNSQueryTimeoutError(name)
Expand Down