fix: log init exceptions

This commit is contained in:
Vlad Stan 2022-12-09 10:31:29 +02:00
parent 0d4954c01a
commit 60bb556f2c

View file

@ -137,6 +137,7 @@ def register_startup(app: FastAPI):
@app.on_event("startup") @app.on_event("startup")
async def lnbits_startup(): async def lnbits_startup():
try:
# 1. wait till migration is done # 1. wait till migration is done
await migrate_databases() await migrate_databases()
@ -150,6 +151,9 @@ def register_startup(app: FastAPI):
# 4. initialize funding source # 4. initialize funding source
await check_funding_source() await check_funding_source()
except Exception as e:
logger.error(str(e))
raise ImportError("Failed to run 'startup' event.")
def log_server_info(): def log_server_info():