MCPcopy Create free account
hub / github.com/chieapp/chie / showError

Function showError

src/controller/exception-handler.ts:12–28  ·  view source on GitHub ↗
(error: Error)

Source from the content-addressed store, hash-verified

10process.on('unhandledRejection', showError);
11
12function showError(error: Error) {
13 const dialog = gui.MessageBox.create();
14 dialog.setType('error');
15 if (process.platform != 'darwin')
16 dialog.setTitle('Error');
17 dialog.setText(error.message);
18 dialog.setInformativeText(error.stack);
19 dialog.addButton('Copy error', 0);
20 dialog.setDefaultResponse(0);
21 dialog.addButton('Close', -1);
22 if (dialog.run() == 0)
23 gui.Clipboard.get().setText(`${error.message}\n${error.stack}`);
24 if (quitOnException) {
25 gui.MessageLoop.quit();
26 process.exit(1);
27 }
28}

Callers

nothing calls this directly

Calls 4

setTextMethod · 0.80
quitMethod · 0.80
setTitleMethod · 0.45
addButtonMethod · 0.45

Tested by

no test coverage detected