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

Function extractErrorMessage

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

Source from the content-addressed store, hash-verified

61
62// Helper function to extract error messages properly
63function extractErrorMessage(error: any): string {
64 if (typeof error === 'string') return error;
65 if (error instanceof Error) return error.message;
66 if (error?.message) return error.message;
67 if (error?.toString && typeof error.toString === 'function') return error.toString();
68 return String(error);
69}
70
71/**
72 * Execute JavaScript handler for processing agent responses

Callers 1

executeJavaScriptFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected