1
0

daemon error-handling: fix traceback.format_exception() on old python

The new API for traceback.format_exception was only added in python 3.10 (91e93794d5).
This commit is contained in:
SomberNight
2024-06-05 14:45:28 +00:00
parent 444b3f3e17
commit 0866581b2c
3 changed files with 13 additions and 3 deletions

View File

@@ -46,7 +46,7 @@ from .network import Network
from .util import (json_decode, to_bytes, to_string, profiler, standardize_path, constant_time_compare, InvalidPassword)
from .invoices import PR_PAID, PR_EXPIRED
from .util import log_exceptions, ignore_exceptions, randrange, OldTaskGroup, UserFacingException, JsonRPCError
from .util import EventListener, event_listener
from .util import EventListener, event_listener, traceback_format_exception
from .wallet import Wallet, Abstract_Wallet
from .storage import WalletStorage
from .wallet_db import WalletDB, WalletRequiresSplit, WalletRequiresUpgrade, WalletUnfinished
@@ -264,7 +264,7 @@ class AuthenticatedServer(Logger):
'message': "internal error while executing RPC",
'data': {
"exception": repr(e),
"traceback": "".join(traceback.format_exception(e)),
"traceback": "".join(traceback_format_exception(e)),
},
}
return web.json_response(response)