MCPcopy Create free account
hub / github.com/Roy3838/Observer / extractErrorMessage

Function extractErrorMessage

app/src/utils/handlers/javascript.ts:50–56  ·  view source on GitHub ↗
(error: any)

Source from the content-addressed store, hash-verified

48
49// Helper function to extract error messages properly
50function extractErrorMessage(error: any): string {
51 if (typeof error === 'string') return error;
52 if (error instanceof Error) return error.message;
53 if (error?.message) return error.message;
54 if (error?.toString && typeof error.toString === 'function') return error.toString();
55 return String(error);
56}
57
58/**
59 * Execute JavaScript handler for processing agent responses

Callers 1

executeJavaScriptFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected