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:
1 parent
c3f4000817
commit
7aa2d672ce
3 files changed
+103
No files matched your search
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user