neterr

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package neterr centralizes the single question three call sites need to answer the same way: did a request fail at the transport layer — before any HTTP response came back?

The provider probe, Add's synchronous probe, and `cc-fleet refresh` all classify a models-endpoint failure as either "provider unreachable" (network/DNS/dial/TLS /timeout) or "provider answered, just unhappily" (any HTTP status). This package is the one shared definition of that distinction.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsTransport

func IsTransport(err error) bool

IsTransport reports whether err is a connection-layer failure — i.e. no HTTP response was ever received. It is the union of the transport-layer cases the call sites care about:

  • context.DeadlineExceeded — our own timeout fired
  • *url.Error whose Timeout() is true — client-side request timeout
  • *net.DNSError — name resolution failed
  • *net.OpError — dial / connect / TLS / read failure

Any other error (including an *url.Error that did not time out, e.g. a bad redirect) is treated as non-transport: the provider is reachable and the failure is something the caller should surface differently. Detection is structural (errors.Is / errors.As) so it survives wrapping, and IsTransport reports false for a nil error.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL