mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
Detect database corruption consistently
This commit is contained in:
10
ts/sql/errors.ts
Normal file
10
ts/sql/errors.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
export function isCorruptionError(error?: Error): boolean {
|
||||
return (
|
||||
error?.message?.includes('SQLITE_CORRUPT') ||
|
||||
error?.message?.includes('database disk image is malformed') ||
|
||||
false
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user