Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Commit

Permalink
Add error message and stack info into the advertise message
Browse files Browse the repository at this point in the history
  • Loading branch information
jc-fireball committed Nov 24, 2015
1 parent 45c1f7f commit deaa283
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tchannel/tornado/hyperbahn.py
Expand Up @@ -68,10 +68,10 @@ def _advertise(tchannel, service):
ttl=2.0,
)
except Exception as e: # Big scope to keep it alive.
log.warn('Failed to register with Hyperbahn: %s', e)
log.info('Failed to register with Hyperbahn: %s', e, exc_info=True)
else:
if response.code != StatusCode.ok:
log.warn('Failed to register with Hyperbahn: %s', response)
log.info('Failed to register with Hyperbahn: %s', response)
else:
log.info('Successfully registered with Hyperbahn')

Expand All @@ -86,7 +86,9 @@ def _advertise_with_backoff(tchannel, service, timeout=None):

while True:
if timeout and time.time() - start > timeout:
raise TimeoutError("Failed to register with Hyperbahn.")
raise TimeoutError(
"Failed to register with Hyperbahn due to timeout.",
)

response = yield _advertise(tchannel, service)

Expand Down

0 comments on commit deaa283

Please sign in to comment.