isTimeoutError checks if an error is a timeout error
(err error)
| 338 | |
| 339 | // isTimeoutError checks if an error is a timeout error |
| 340 | func isTimeoutError(err error) bool { |
| 341 | if err == nil { |
| 342 | return false |
| 343 | } |
| 344 | |
| 345 | // Check for timeoutError interface (works with wrapped errors) |
| 346 | var te timeoutError |
| 347 | if errors.As(err, &te) { |
| 348 | return te.Timeout() |
| 349 | } |
| 350 | |
| 351 | // Check for net.Error specifically (common case for network timeouts) |
| 352 | var netErr net.Error |
| 353 | if errors.As(err, &netErr) { |
| 354 | return netErr.Timeout() |
| 355 | } |
| 356 | |
| 357 | return false |
| 358 | } |
| 359 | |
| 360 | // getErrorCategory returns the error category from an error. |
| 361 | // It checks for TLS, auth, network, and server errors. |
no test coverage detected