diff --git a/apps/simplex-support-bot-light/src/support_bot_light/dry_run.py b/apps/simplex-support-bot-light/src/support_bot_light/dry_run.py index 8da57e70f2..25c6d9456a 100644 --- a/apps/simplex-support-bot-light/src/support_bot_light/dry_run.py +++ b/apps/simplex-support-bot-light/src/support_bot_light/dry_run.py @@ -59,7 +59,7 @@ def migration_error_text(e: ChatInitError) -> str: names = me.get("downMigrations", []) return f"database is newer than this build, to roll back: {', '.join(names)}" return f"migration state error: {json.dumps(me)}" - return str(e) + return json.dumps(err) def probe_of(e: ChatInitError) -> Probe: diff --git a/apps/simplex-support-bot-light/tests/test_dry_run.py b/apps/simplex-support-bot-light/tests/test_dry_run.py index 11968e6fe8..d7a84f5b1d 100644 --- a/apps/simplex-support-bot-light/tests/test_dry_run.py +++ b/apps/simplex-support-bot-light/tests/test_dry_run.py @@ -43,7 +43,10 @@ DIFFERENT = ChatInitError( }, }, ) -NOT_A_DATABASE = ChatInitError("not a database", {"type": "errorNotADatabase", "dbFile": "x"}) +NOT_A_DATABASE = ChatInitError( + "Database or migration error (see db_migration_error)", + {"type": "errorNotADatabase", "dbFile": "x"}, +) CHAT_NOT_STARTED = {"type": "error", "errorType": {"type": "chatNotStarted"}} @@ -97,7 +100,9 @@ def test_probe_reports_other_errors_as_failed_with_their_text(): different = dr.probe_of(DIFFERENT) assert different.kind == "failed" assert different.text.startswith("migration state error: ") - assert dr.probe_of(NOT_A_DATABASE) == dr.Probe("failed", text="not a database") + assert dr.probe_of(NOT_A_DATABASE) == dr.Probe( + "failed", text='{"type": "errorNotADatabase", "dbFile": "x"}' + ) def test_plan_for_a_current_schema_opens_without_migrating():