From 2344e98e395c7149ac8dfd3002d966a602a69120 Mon Sep 17 00:00:00 2001 From: automated-signal <37887102+automated-signal@users.noreply.github.com> Date: Wed, 21 Aug 2024 02:53:34 -0500 Subject: [PATCH] Fix unhandled promise rejection text content Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com> --- app/global_errors.ts | 7 ++++++- app/main.ts | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/global_errors.ts b/app/global_errors.ts index 8c278ff610..3a3fc092c6 100644 --- a/app/global_errors.ts +++ b/app/global_errors.ts @@ -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); diff --git a/app/main.ts b/app/main.ts index fefd28821f..a3ab3926a6 100644 --- a/app/main.ts +++ b/app/main.ts @@ -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' &&