|
1 | 1 | const DEV_MODE = process.env.HTK_DEV === 'true';
|
2 | 2 |
|
3 | 3 | // Set up error handling before everything else:
|
4 |
| -import { reportError, addBreadcrumb } from './errors'; |
| 4 | +import { logError, addBreadcrumb } from './errors'; |
5 | 5 |
|
6 | 6 | import { spawn, ChildProcess } from 'child_process';
|
7 | 7 | import * as os from 'os';
|
@@ -162,7 +162,7 @@ if (!amMainInstance) {
|
162 | 162 | await stopServer(server, AUTH_TOKEN);
|
163 | 163 | } catch (error) {
|
164 | 164 | console.log('Failed to kill server', error);
|
165 |
| - reportError(error); |
| 165 | + logError(error); |
166 | 166 | } finally {
|
167 | 167 | // We've done our best - now shut down for real.
|
168 | 168 | app.quit();
|
@@ -225,7 +225,7 @@ if (!amMainInstance) {
|
225 | 225 | contents.on('render-process-gone', (_event, details) => {
|
226 | 226 | if (details.reason === 'clean-exit') return;
|
227 | 227 |
|
228 |
| - reportError(`Renderer gone: ${details.reason}`); |
| 228 | + logError(`Renderer gone: ${details.reason}`); |
229 | 229 | showErrorAlert(
|
230 | 230 | "UI crashed",
|
231 | 231 | "The HTTP Toolkit UI stopped unexpected.\n\nPlease file an issue at github.com/httptoolkit/httptoolkit."
|
@@ -336,7 +336,7 @@ if (!amMainInstance) {
|
336 | 336 | )) {
|
337 | 337 | // If the folder contains something other than the expected version folders, be careful.
|
338 | 338 | console.log(serverPaths);
|
339 |
| - reportError( |
| 339 | + logError( |
340 | 340 | `Server path (${serverUpdatesPath}) contains unexpected content, ignoring`
|
341 | 341 | );
|
342 | 342 | return;
|
@@ -448,7 +448,7 @@ if (!amMainInstance) {
|
448 | 448 | }
|
449 | 449 |
|
450 | 450 | addBreadcrumb({ category: 'server-exit', message: error.message, level: <any>'error', data: { serverRunTime } });
|
451 |
| - reportError(error); |
| 451 | + logError(error); |
452 | 452 |
|
453 | 453 | showErrorAlert(
|
454 | 454 | 'HTTP Toolkit hit an error',
|
@@ -539,7 +539,7 @@ if (!amMainInstance) {
|
539 | 539 | // Otherwise we just let Electron use the defaults - no problem at all.
|
540 | 540 | })
|
541 | 541 | .catch((e) => {
|
542 |
| - reportError(e); |
| 542 | + logError(e); |
543 | 543 | return undefined;
|
544 | 544 | });
|
545 | 545 |
|
|
0 commit comments