errors

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2026 License: CC0-1.0 Imports: 5 Imported by: 0

Documentation

Overview

Package errors provides canonical generators for frequently used network errors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnClosed

func ConnClosed(op, network string, src, addr net.Addr) net.Error

ConnClosed returns a net.Error representing an operation on a closed network connection. The op parameter is the operation being performed (e.g. "read", "write"). The network parameter is the network type (e.g. "tcp", "udp"). src and addr represent the source and destination addresses of the connection.

func ConnRefused

func ConnRefused(n, a string) error

ConnRefused returns an error representing a connection refusal. The n parameter is the network type (e.g. "tcp", "udp"). The a parameter is the address that refused the connection.

func DnsReqErr

func DnsReqErr(host, srv string) error

DnsReqErr returns a net.DNSError representing a DNS request failure. The host parameter is the hostname that was looked up (e.g. example.com). The srv parameter is the DNS server address (e.g. 8.8.8.8:53).

func ListenDeniedErr

func ListenDeniedErr(n, a string) error

ListenDeniedErr returns an error representing a permission denied when attempting to listen on an address. The n parameter is the network type (e.g. "tcp", "udp"). The a parameter is the address that denied the listen attempt.

func NoSuchHost

func NoSuchHost(host, srv string) *net.DNSError

NoSuchHost returns a net.Error representing a DNS lookup failure for the specified host. The host parameter is the hostname that was looked up (e.g. example.com). The srv parameter is the DNS server address (e.g. 8.8.8.8:53).

Types

This section is empty.

Jump to

Keyboard shortcuts

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