Detect database corruption consistently
This commit is contained in:
parent
1184098b42
commit
7510be0caf
7 changed files with 106 additions and 77 deletions
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
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue