feat: 更新 sentry 错误上报

This commit is contained in:
claude-code-best
2026-04-03 09:39:25 +08:00
parent 1f0a2e44c8
commit 119518599e
11 changed files with 493 additions and 2 deletions

View File

@@ -20,6 +20,7 @@ import { logForDebugging } from './debug.js'
import { getFsImplementation } from './fsOperations.js'
import { attachErrorLogSink, dateToFilename } from './log.js'
import { jsonStringify } from './slowOperations.js'
import { captureException } from './sentry.js'
const DATE = dateToFilename(new Date())
@@ -171,6 +172,9 @@ function logErrorImpl(error: Error): void {
appendToLog(getErrorsPath(), {
error: `${context}${errorStr}`,
})
// Also report to Sentry (no-op if not initialized)
captureException(error)
}
/**