mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-22 22:32:23 +00:00
do something sensible on UsageError
This commit is contained in:
parent
c874a388ce
commit
a40364adba
@ -175,7 +175,13 @@ def dispatch(config,
|
|||||||
# 4: return a Deferred that does 1 or 2 or 3
|
# 4: return a Deferred that does 1 or 2 or 3
|
||||||
def _raise_sys_exit(rc):
|
def _raise_sys_exit(rc):
|
||||||
sys.exit(rc)
|
sys.exit(rc)
|
||||||
|
|
||||||
|
def _error(f):
|
||||||
|
f.trap(usage.UsageError)
|
||||||
|
print("Error: {}".format(f.value.message))
|
||||||
|
sys.exit(1)
|
||||||
d.addCallback(_raise_sys_exit)
|
d.addCallback(_raise_sys_exit)
|
||||||
|
d.addErrback(_error)
|
||||||
return d
|
return d
|
||||||
|
|
||||||
def _maybe_enable_eliot_logging(options, reactor):
|
def _maybe_enable_eliot_logging(options, reactor):
|
||||||
|
Loading…
Reference in New Issue
Block a user