fix(network): classify timeout errors as FailoverTimeout

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
LCandCopilot Autofix powered by AI authored and lc6464 committed 2026-04-16 22:00:13 +08:00
1 parent c3f4000817
commit 7aa2d672ce
3 files changed
+103

No files matched your search

+6
View File
@@ -226,12 +226,18 @@ func classifyByErrorType(err error) FailoverReason {
syscall.EPIPE,
} {
if errors.Is(err, transportErr) {
if transportErr == syscall.ETIMEDOUT {
return FailoverTimeout
}
return FailoverNetwork
}
}
var netErr net.Error
if errors.As(err, &netErr) {
if netErr.Timeout() {
return FailoverTimeout
}
return FailoverNetwork
}