pub fn classify_tool_error(error: &(dyn Error + 'static)) -> StringExpand description
Classify a tool execution error into a telemetry-safe string.
In minified/external builds, error.constructor.name is mangled into short identifiers like “nJT” or “Chq” — useless for diagnostics. This function extracts structured, telemetry-safe information instead:
- TelemetrySafeError: use its telemetryMessage (already vetted)
- Node.js fs errors: log the error code (ENOENT, EACCES, etc.)
- Known error types: use their unminified name
- Fallback: “Error” (better than a mangled 3-char identifier)