mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-23 09:38:02 +00:00
fix: improve logging for client disconnections in relay services
当客户端主动断开连接时,改为使用 INFO 级别记录而不是 ERROR 级别, 因为这是正常情况而非错误。 - ccrRelayService: 区分客户端断开与实际错误 - claudeConsoleRelayService: 区分客户端断开与实际错误 - claudeRelayService: 区分客户端断开与实际错误 - droidRelayService: 区分客户端断开与实际错误
This commit is contained in:
@@ -635,10 +635,17 @@ class ClaudeConsoleRelayService {
|
||||
// 更新最后使用时间
|
||||
await this._updateLastUsedTime(accountId)
|
||||
} catch (error) {
|
||||
logger.error(
|
||||
`❌ Claude Console stream relay failed (Account: ${account?.name || accountId}):`,
|
||||
error
|
||||
)
|
||||
// 客户端主动断开连接是正常情况,使用 INFO 级别
|
||||
if (error.message === 'Client disconnected') {
|
||||
logger.info(
|
||||
`🔌 Claude Console stream relay ended: Client disconnected (Account: ${account?.name || accountId})`
|
||||
)
|
||||
} else {
|
||||
logger.error(
|
||||
`❌ Claude Console stream relay failed (Account: ${account?.name || accountId}):`,
|
||||
error
|
||||
)
|
||||
}
|
||||
throw error
|
||||
} finally {
|
||||
// 🛑 清理租约刷新定时器
|
||||
|
||||
Reference in New Issue
Block a user