MCPcopy
hub / github.com/continuedev/continue / reportUnhandledErrorToApi

Function reportUnhandledErrorToApi

extensions/cli/src/index.ts:99–117  ·  view source on GitHub ↗
(error: Error)

Source from the content-addressed store, hash-verified

97
98// Helper to report unhandled errors to the API when running in serve mode
99async function reportUnhandledErrorToApi(error: Error): Promise<void> {
100 if (!agentId) {
101 // Not running in serve mode with an agent ID, skip API reporting
102 return;
103 }
104
105 try {
106 await post(`agents/${agentId}/status`, {
107 status: "FAILED",
108 errorMessage: `Unhandled error: ${error.message}`,
109 });
110 logger.debug(`Reported unhandled error to API for agent ${agentId}`);
111 } catch (apiError) {
112 // If API reporting fails, just log it - don't crash
113 logger.debug(
114 `Failed to report error to API: ${apiError instanceof Error ? apiError.message : String(apiError)}`,
115 );
116 }
117}
118
119// Add global error handlers to prevent uncaught errors from crashing the process
120process.on("unhandledRejection", (reason, promise) => {

Callers 1

index.tsFile · 0.85

Calls 2

postFunction · 0.85
debugMethod · 0.45

Tested by

no test coverage detected