misc: better reporting of errors
This commit is contained in:
parent
5926596298
commit
f191d95990
|
@ -165,4 +165,5 @@ def run(cli_args=None, hidraw_path=None):
|
||||||
tb_last = extract_tb(_sys.exc_info()[2])[-1]
|
tb_last = extract_tb(_sys.exc_info()[2])[-1]
|
||||||
_sys.exit('%s: assertion failed: %s line %d' % (NAME.lower(), tb_last[0], tb_last[1]))
|
_sys.exit('%s: assertion failed: %s line %d' % (NAME.lower(), tb_last[0], tb_last[1]))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
_sys.exit('%s: error: %s' % (NAME.lower(), e))
|
from traceback import format_exc
|
||||||
|
_sys.exit('%s: error: %s' % (NAME.lower(), format_exc()))
|
||||||
|
|
|
@ -118,7 +118,8 @@ def main():
|
||||||
ui.run_loop(listener.start_all, listener.stop_all, args.window!='only', args.window!='hide')
|
ui.run_loop(listener.start_all, listener.stop_all, args.window!='only', args.window!='hide')
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
import sys
|
import sys
|
||||||
sys.exit('%s: error: %s' % (NAME.lower(), e))
|
from traceback import format_exc
|
||||||
|
sys.exit('%s: error: %s' % (NAME.lower(), format_exc()))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Reference in New Issue