MCPcopy Index your code
hub / github.com/coder/mux / errorMessageText

Function errorMessageText

src/node/runtime/SSH2ConnectionPool.ts:204–206  ·  view source on GitHub ↗

Extract a message string from an error for `.includes()` matching. * Unlike getErrorMessage, this doesn't walk the cause chain and returns "" * for non-Error, non-string values — intentionally narrow for match guards.

(error: unknown)

Source from the content-addressed store, hash-verified

202 * Unlike getErrorMessage, this doesn't walk the cause chain and returns ""
203 * for non-Error, non-string values — intentionally narrow for match guards. */
204function errorMessageText(error: unknown): string {
205 return error instanceof Error ? error.message : typeof error === "string" ? error : "";
206}
207
208/**
209 * Detect if error is due to encrypted key without passphrase.

Callers 2

isEncryptedKeyErrorFunction · 0.85
isAuthFailureFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected