MCPcopy
hub / github.com/HisMax/RedInk / inferTitle

Function inferTitle

frontend/src/utils/errors.ts:116–130  ·  view source on GitHub ↗
(message: string, fallbackTitle: string)

Source from the content-addressed store, hash-verified

114}
115
116function inferTitle(message: string, fallbackTitle: string): string {
117 const code = inferCode(message)
118 const titles: Record<string, string> = {
119 PROXY_UNAVAILABLE: '本机代理不可用',
120 NETWORK_FAKE_IP_TLS: '网络代理连接异常',
121 MODEL_ENDPOINT_MISMATCH: '模型与接口不匹配',
122 ENDPOINT_METHOD_MISMATCH: '接口路径或请求方法不匹配',
123 AUTH_OR_PERMISSION: 'API Key 或权限不可用',
124 RATE_LIMITED: '上游限流或配额不足',
125 NETWORK_TIMEOUT: '网络请求超时',
126 RESOURCE_NOT_FOUND: '资源不存在',
127 UNKNOWN_ERROR: fallbackTitle
128 }
129 return titles[code] || fallbackTitle
130}
131
132function inferSuggestion(message: string): string {
133 const code = inferCode(message)

Callers 1

legacyMessageToErrorFunction · 0.85

Calls 1

inferCodeFunction · 0.85

Tested by

no test coverage detected