mirror of
https://github.com/httpie/cli.git
synced 2025-01-12 08:38:28 +01:00
Fixed error handling.
This commit is contained in:
parent
e045ca6bd8
commit
4b1a04e5ed
@ -143,6 +143,7 @@ def main(args=sys.argv[1:], env=Environment()):
|
|||||||
Return exit status.
|
Return exit status.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
debug = '--debug' in args
|
||||||
|
|
||||||
if env.is_windows and not env.stdout_isatty:
|
if env.is_windows and not env.stdout_isatty:
|
||||||
env.stderr.write(
|
env.stderr.write(
|
||||||
@ -178,9 +179,9 @@ def main(args=sys.argv[1:], env=Environment()):
|
|||||||
env.stderr.write('\n')
|
env.stderr.write('\n')
|
||||||
return 1
|
return 1
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
if '--debug' in args:
|
if debug:
|
||||||
raise
|
raise
|
||||||
env.stderr.write(str(repr(e) + '\n'))
|
env.stderr.write(str(e.message) + '\n')
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
return status
|
return status
|
||||||
|
Loading…
Reference in New Issue
Block a user