Fix unhandled promise rejection text content
This commit is contained in:
parent
301f7a505a
commit
7431afa206
2 changed files with 9 additions and 2 deletions
|
@ -2,6 +2,7 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { app, dialog, clipboard } from 'electron';
|
||||
import os from 'node:os';
|
||||
|
||||
import * as Errors from '../ts/types/errors';
|
||||
import { redactAll } from '../ts/util/privacy';
|
||||
|
@ -31,7 +32,11 @@ function handleError(prefix: string, error: Error): void {
|
|||
});
|
||||
|
||||
if (buttonIndex === 1) {
|
||||
clipboard.writeText(`${prefix}\n\n${redactAll(formattedError)}`);
|
||||
clipboard.writeText(
|
||||
`${prefix}\n\n${redactAll(formattedError)}\n\n` +
|
||||
`App Version: ${app.getVersion()}\n` +
|
||||
`OS: ${os.platform()}`
|
||||
);
|
||||
}
|
||||
} else {
|
||||
dialog.showErrorBox(prefix, formattedError);
|
||||
|
|
|
@ -1847,7 +1847,9 @@ const onDatabaseError = async (error: Error) => {
|
|||
|
||||
if (buttonIndex === copyErrorAndQuitButtonIndex) {
|
||||
clipboard.writeText(
|
||||
`Database startup error:\n\n${redactAll(Errors.toLogFormat(error))}`
|
||||
`Database startup error:\n\n${redactAll(Errors.toLogFormat(error))}\n\n` +
|
||||
`App Version: ${app.getVersion()}\n` +
|
||||
`OS: ${os.platform()}`
|
||||
);
|
||||
} else if (
|
||||
typeof deleteAllDataButtonIndex === 'number' &&
|
||||
|
|
Loading…
Reference in a new issue