1
0
mirror of https://github.com/httpie/cli.git synced 2024-11-28 08:38:44 +02:00

Fixed error handling.

This commit is contained in:
Jakub Roztocil 2012-08-02 04:33:43 +02:00
parent e045ca6bd8
commit 4b1a04e5ed

View File

@ -143,6 +143,7 @@ def main(args=sys.argv[1:], env=Environment()):
Return exit status.
"""
debug = '--debug' in args
if env.is_windows and not env.stdout_isatty:
env.stderr.write(
@ -178,9 +179,9 @@ def main(args=sys.argv[1:], env=Environment()):
env.stderr.write('\n')
return 1
except Exception as e:
if '--debug' in args:
if debug:
raise
env.stderr.write(str(repr(e) + '\n'))
env.stderr.write(str(e.message) + '\n')
return 1
return status