mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-18 21:16:47 +00:00
175f5d96da
SqliteDatabaseBackup.replace reopens the connection in a finally block, so it runs even when the swap throws. A reopen that failed there was stored and then dropped: the swap's exception propagated past the return that would have carried it. The demo reset caught that swap error, logged "Failed to restore baseline" and returned normally, leaving the instance without a database connection and nothing in the log to say so. Before the port, the same branch awaited reinitialize() and its rejection reached the tick's log line. replace now throws a DatabaseConnectionLostError when both steps fail. It carries the swap error and has the reopen failure as its cause, and its message tells the operator to restart. The demo reset lets that error through to DemoResetJob's tick, which logs it, and still logs and skips a failed swap whose reopen succeeded. A restore that hits it answers the same 500 as any other thrown restore error, with both failures in the server log.