From f574d34357d7ad84b393124f0a4c7fba50a2aa53 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Mon, 3 Jun 2024 03:02:00 -0700 Subject: [PATCH] wrap migrations maker in try catch --- archivebox/index/sql.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/archivebox/index/sql.py b/archivebox/index/sql.py index 3c4c2a96..b1497977 100644 --- a/archivebox/index/sql.py +++ b/archivebox/index/sql.py @@ -143,7 +143,12 @@ def list_migrations(out_dir: Path=OUTPUT_DIR) -> List[Tuple[bool, str]]: def apply_migrations(out_dir: Path=OUTPUT_DIR) -> List[str]: from django.core.management import call_command null, out = StringIO(), StringIO() - call_command("makemigrations", interactive=False, stdout=null) + try: + call_command("makemigrations", interactive=False, stdout=null) + except Exception as e: + print('[!] Failed to create some migrations. Please open an issue and copy paste this output for help: {}'.format(e)) + print() + call_command("migrate", interactive=False, stdout=out) out.seek(0)