MCPcopy Create free account
hub / github.com/Tele-AI/doc-ops-mcp / logError

Method logError

src/security/errorHandler.ts:31–43  ·  view source on GitHub ↗
(context: string, error: any)

Source from the content-addressed store, hash-verified

29
30 // 记录错误但不泄露敏感信息
31 static logError(context: string, error: any): void {
32 const safeMessage = this.sanitizeErrorMessage(error);
33
34 if (this.isDevelopment) {
35 console.error(`${context}: ${safeMessage}`);
36 console.error('Stack:', error.stack);
37 } else {
38 // 生产环境:只记录安全的信息
39 console.error(`${context}: ${safeMessage}`);
40 // 可以将完整错误发送到内部日志系统
41 this.sendToInternalLogging(context, error);
42 }
43 }
44
45 private static sendToInternalLogging(context: string, error: any): void {
46 // 实现内部日志记录,不对外暴露

Callers 3

tryCustomOOXMLParserFunction · 0.80
processDocxAsTextFunction · 0.80
readDocumentFunction · 0.80

Calls 2

sanitizeErrorMessageMethod · 0.95
sendToInternalLoggingMethod · 0.95

Tested by

no test coverage detected