From a64f29de6c6cb5e3ad8ad30ebed6bc31c168a81e Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Tue, 8 Jul 2025 15:44:02 +1200 Subject: [PATCH] Add note to bad schema exception Requires python >= 3.11 (oss-cad-suite is 3.11.6, but there isn't any minimum python version given for SBY that I can find). Makes the error less opaque (even though it still has the trace), which I think is necessary given that using the status db is totally optional and otherwise using a different version of SBY with an extra db field in a directory where a previous version has run will just crash with an obscure sqlite3.OperationalError. --- sbysrc/sby_status.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sbysrc/sby_status.py b/sbysrc/sby_status.py index cb91174..ec18b8d 100644 --- a/sbysrc/sby_status.py +++ b/sbysrc/sby_status.py @@ -69,6 +69,9 @@ def transaction(method: Fn) -> Fn: self.log_debug(f"failed {method.__name__!r} transaction {err}") if not isinstance(err, sqlite3.OperationalError): raise + if re.match("table \w+ has no column named \w+", err.args[0]): + err.add_note("SBY status database can be reset with --statusreset") + raise else: self.log_debug(f"comitted {method.__name__!r} transaction") return result