Last active
November 4, 2015 05:23
-
-
Save sjmh/2e173ecaa4241d511c25 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here's the code from an execution module: | |
try: | |
return client.watch(key, recurse=recurse, wait=True, timeout=timeout, index=index) | |
except urllib3.exceptions.ReadTimeoutError as e: | |
return 'got timeout' | |
except Exception as e: | |
return str(type(e)) | |
When it runs: | |
[root@alpha site-packages]# /tmp/watch.py | |
{'alpha': "<class 'urllib3.exceptions.ReadTimeoutError'>"} | |
Meaning that it fell through to 'Exception', even though the specific Exception type is right above it and should have returned 'got timeout' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment