Theia API Documentation v1.77.0
    Preparing search index...
    • Builds an error message string that also incorporates the cause chain.

      Node's fetch (undici) throws TypeError: fetch failed while the actionable reason (e.g. ECONNREFUSED, ENOTFOUND, a TLS error) lives on error.cause. Provider SDKs often wrap that again. This walks the chain and appends each distinct cause message/code.

      Because the RPC error extension only serializes code, data, message, name and stack (see rpc-message-encoder.ts), the cause is gone by the time a frontend agent sees a backend error. The node-side language model frontend delegate therefore flattens the chain into the message before the error crosses the RPC boundary, so the actionable reason survives. Frontend consumers can still call this defensively for locally thrown errors that keep their cause.

      Parameters

      • error: unknown

      Returns string