netcause

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package netcause names the cause of a transport-level failure, so a request that never left the machine is not reported as a credential or server problem.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Denied

func Denied(err error) bool

Denied reports whether the operating system refused the connection itself (EPERM/EACCES from connect), as a sandbox or firewall does. Nothing reached the server, so no credential change can fix it.

func Hint

func Hint(err error) string

Hint explains a transport failure whose cause can be named, or returns "" when it cannot, or when Transport already added the explanation to err. A failed DNS lookup is named but not attributed: a blocked resolver and a host that does not exist look the same from here.

func Transport

func Transport(next http.RoundTripper) http.RoundTripper

Transport returns next wrapped so a transport failure whose cause Hint can name carries that explanation in its message; the original error stays in the chain for errors.Is. Wrap at the base of a client's chain, so requests a higher transport synthesizes itself (token exchange, discovery) are covered too.

Types

This section is empty.

Jump to

Keyboard shortcuts

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