Skip to content

Documentation / @agentick/mcp / sanitizeErrorMessage

Function: sanitizeErrorMessage()

sanitizeErrorMessage(message, fallback?): string

Defined in: protocol/errors.ts:36

Sanitize an error message for client consumption. Strips stack traces, file paths, connection strings, and secrets. Returns a generic message if anything sensitive is detected.

Parameters

message

string

fallback?

string = "Internal server error"

Returns

string

Released under the ISC License.