Update database error confirmation dialogs

This commit is contained in:
trevor-signal
2023-09-21 10:13:25 -04:00
committed by GitHub
parent 3a9862a1b6
commit 503620fe00
3 changed files with 83 additions and 21 deletions

View File

@@ -2013,6 +2013,10 @@ export const SCHEMA_VERSIONS = [
updateToSchemaVersion950,
];
export class DBVersionFromFutureError extends Error {
override name = 'DBVersionFromFutureError';
}
export function updateSchema(db: Database, logger: LoggerType): void {
const sqliteVersion = getSQLiteVersion(db);
const sqlcipherVersion = getSQLCipherVersion(db);
@@ -2029,9 +2033,9 @@ export function updateSchema(db: Database, logger: LoggerType): void {
);
if (startingVersion > MAX_VERSION) {
throw new Error(
throw new DBVersionFromFutureError(
`SQL: User version is ${startingVersion} but the expected maximum version ` +
`is ${MAX_VERSION}. Did you try to start an old version of Signal?`
`is ${MAX_VERSION}.`
);
}