fix: correct API error log file path display

This commit is contained in:
CrazyBoyM 2025-08-25 06:40:30 +08:00
parent b6a2e7e41b
commit 3c13c20587

View File

@ -471,7 +471,12 @@ export function logAPIError(context: {
// 确保目录存在
if (!existsSync(errorDir)) {
mkdirSync(errorDir, { recursive: true })
try {
mkdirSync(errorDir, { recursive: true })
} catch (err) {
console.error('Failed to create error log directory:', err)
return // Exit early if we can't create the directory
}
}
// 生成文件名
@ -557,7 +562,7 @@ export function logAPIError(context: {
}
console.log()
console.log(chalk.dim(` 📁 Full log: ~/.kode/logs/error/api/${filename}`))
console.log(chalk.dim(` 📁 Full log: ${filepath}`))
console.log(chalk.red('━'.repeat(60)))
console.log()
}