()
| 114 | import { runZedIntegration } from './zed-integration/zedIntegration.js'; |
| 115 | |
| 116 | export function setupUnhandledRejectionHandler() { |
| 117 | let unhandledRejectionOccurred = false; |
| 118 | process.on('unhandledRejection', (reason, _promise) => { |
| 119 | const errorMessage = `========================================= |
| 120 | This is an unexpected error. Please file a bug report using the /bug tool. |
| 121 | CRITICAL: Unhandled Promise Rejection! |
| 122 | ========================================= |
| 123 | Reason: ${reason}${ |
| 124 | reason instanceof Error && reason.stack |
| 125 | ? ` |
| 126 | Stack trace: |
| 127 | ${reason.stack}` |
| 128 | : '' |
| 129 | }`; |
| 130 | appEvents.emit(AppEvent.LogError, errorMessage); |
| 131 | if (!unhandledRejectionOccurred) { |
| 132 | unhandledRejectionOccurred = true; |
| 133 | appEvents.emit(AppEvent.OpenDebugConsole); |
| 134 | } |
| 135 | }); |
| 136 | } |
| 137 | |
| 138 | export async function main() { |
| 139 | setupUnhandledRejectionHandler(); |
no outgoing calls
no test coverage detected