Better reporting for DB corruption errors
This commit is contained in:
parent
092c2fd0d7
commit
1b1ed2cd05
7 changed files with 43 additions and 5 deletions
|
@ -276,6 +276,7 @@ const dataInterface: ServerInterface = {
|
|||
|
||||
// Server-only
|
||||
|
||||
getCorruptionLog,
|
||||
initialize,
|
||||
initializeRenderer,
|
||||
|
||||
|
@ -2695,6 +2696,19 @@ let globalInstanceRenderer: Database | undefined;
|
|||
let databaseFilePath: string | undefined;
|
||||
let indexedDBPath: string | undefined;
|
||||
|
||||
let corruptionLog = new Array<string>();
|
||||
|
||||
SQL.setCorruptionLogger(line => {
|
||||
logger.error(`SQL corruption: ${line}`);
|
||||
corruptionLog.push(line);
|
||||
});
|
||||
|
||||
function getCorruptionLog(): string {
|
||||
const result = corruptionLog.join('\n');
|
||||
corruptionLog = [];
|
||||
return result;
|
||||
}
|
||||
|
||||
async function initialize({
|
||||
configDir,
|
||||
key,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue