chore(lint): cleanup repeated cause exception in logging.exception replaced by helpful message (#10425)

This commit is contained in:
Bowen Liang
2024-11-15 15:41:40 +08:00
committed by GitHub
parent db1d2aaff5
commit 51db59622c
47 changed files with 83 additions and 72 deletions

View File

@@ -589,7 +589,7 @@ def upgrade_db():
click.echo(click.style("Database migration successful!", fg="green"))
except Exception as e:
logging.exception(f"Database migration failed: {e}")
logging.exception("Failed to execute database migration")
finally:
lock.release()
else:
@@ -633,7 +633,7 @@ where sites.id is null limit 1000"""
except Exception as e:
failed_app_ids.append(app_id)
click.echo(click.style("Failed to fix missing site for app {}".format(app_id), fg="red"))
logging.exception(f"Fix app related site missing issue failed, error: {e}")
logging.exception(f"Failed to fix app related site missing issue, app_id: {app_id}")
continue
if not processed_count: