nft-update-addresses: improve error reportings from inside threads

main
Felix Stupp 1 year ago
parent 6e74da5a70
commit 4cd830ba6e
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -66,7 +66,13 @@ logger = logging.getLogger(__name__)
def raise_and_exit(args: Any) -> None:
Timer(0.01, os._exit, args=(1,)).start()
raise args[0]
logging.error(repr(args.exc_value))
logger.error(
"\n".join(traceback.format_tb(args.exc_traceback))
if args.exc_traceback != None
else "traceback from thread got lost!"
)
raise args.exc_value or Exception(f"{args.exc_type} (exception details got lost)")
# ensure exceptions in any thread brings the program down

Loading…
Cancel
Save