3
0
Fork 0
mirror of https://github.com/YosysHQ/sby.git synced 2025-08-15 01:15:30 +00:00

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.
This commit is contained in:
Krystine Sherwin 2025-07-08 15:44:02 +12:00
parent b1d9bcbb42
commit a64f29de6c
No known key found for this signature in database

View file

@ -69,6 +69,9 @@ def transaction(method: Fn) -> Fn:
self.log_debug(f"failed {method.__name__!r} transaction {err}") self.log_debug(f"failed {method.__name__!r} transaction {err}")
if not isinstance(err, sqlite3.OperationalError): if not isinstance(err, sqlite3.OperationalError):
raise 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: else:
self.log_debug(f"comitted {method.__name__!r} transaction") self.log_debug(f"comitted {method.__name__!r} transaction")
return result return result