Skip to content

Commit ad074b4

Browse files
committed
Include log path in crash error alerts to help users debug
1 parent 44eec29 commit ad074b4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ const RESOURCES_PATH = APP_PATH.endsWith('app.asar')
4444
? path.dirname(APP_PATH) // If we're bundled, resources are above the bundle
4545
: APP_PATH; // Otherwise everything is in the root of the app
4646
const LOGS_PATH = app.getPath('logs');
47+
const LAST_RUN_LOG_PATH = path.join(LOGS_PATH, 'last-run.log');
4748

4849
// Keep a global reference of the window object, if you don't, the window will
4950
// be closed automatically when the JavaScript object is garbage collected.
@@ -125,7 +126,7 @@ if (!amMainInstance) {
125126
console.log('Not the main instance - quitting');
126127
app.quit();
127128
} else {
128-
const logStream = createWriteStream(path.join(LOGS_PATH, 'last-run.log'));
129+
const logStream = createWriteStream(LAST_RUN_LOG_PATH);
129130
logStream.write(`--- Launching HTTP Toolkit desktop v${DESKTOP_VERSION} ---\n`);
130131

131132
const args = yargs
@@ -458,7 +459,9 @@ if (!amMainInstance) {
458459

459460
showErrorAlert(
460461
'HTTP Toolkit hit an error',
461-
`${error.message}.\n\nPlease file an issue at github.com/httptoolkit/httptoolkit.`
462+
`${error.message}.\n\n` +
463+
`See ${LAST_RUN_LOG_PATH} for more details.\n\n` +
464+
`Please file an issue at github.com/httptoolkit/httptoolkit.`
462465
);
463466

464467
// Retry limited times, but not for near-immediate failures.

0 commit comments

Comments
 (0)