TestWrapDoAPIError_Timeout pins that an SDK transport error whose chain carries a net.Error with Timeout()==true classifies as NetworkError{Subtype: timeout}. Covers the E2E timeout scenario (HTTPS_PROXY pointing at a non-routable address).
(t *testing.T)
| 72 | // NetworkError{Subtype: timeout}. Covers the E2E timeout scenario |
| 73 | // (HTTPS_PROXY pointing at a non-routable address). |
| 74 | func TestWrapDoAPIError_Timeout(t *testing.T) { |
| 75 | got := WrapDoAPIError(&net.OpError{Op: "dial", Net: "tcp", Err: timeoutNetError{}}) |
| 76 | var ne *errs.NetworkError |
| 77 | if !errors.As(got, &ne) { |
| 78 | t.Fatalf("expected *errs.NetworkError, got %T (%v)", got, got) |
| 79 | } |
| 80 | if ne.Subtype != errs.SubtypeNetworkTimeout { |
| 81 | t.Errorf("Subtype = %v, want %v", ne.Subtype, errs.SubtypeNetworkTimeout) |
| 82 | } |
| 83 | if ne.Category != errs.CategoryNetwork { |
| 84 | t.Errorf("Category = %v, want %v", ne.Category, errs.CategoryNetwork) |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | // TestWrapDoAPIError_TLS pins that an x509.UnknownAuthorityError classifies |
| 89 | // as NetworkError{Subtype: tls}. |
nothing calls this directly
no test coverage detected