Skip to content

Commit 1407d92

Browse files
authored
narrow and print out top-level exception (#111)
Signed-off-by: Matthew Peveler <matt.peveler@gmail.com>
1 parent a81224d commit 1407d92

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tldr.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,8 @@ def main():
366366
).format(cmd=command), file=sys.stderr)
367367
else:
368368
output(result)
369-
except Exception:
370-
sys.exit("No internet connection detected. Please reconnect and try again.")
369+
except URLError as e:
370+
sys.exit("Error fetching from tldr: {}".format(e))
371371

372372

373373
def cli():

0 commit comments

Comments
 (0)