apierr

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package apierr turns raw HTTP error responses from Bitwave services into messages a human can act on. Servers variously return JSON error envelopes, bare text, or whole HTML error pages (e.g. a gateway 404) — none of which should be dumped verbatim into a CLI error.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format(status int, method, url string, body []byte) error

Format builds a readable error for a non-2xx response. method and url describe the request; body is the (possibly empty) response body.

Types

type Error

type Error struct {
	Status int
	Method string
	URL    string
	Detail string
}

Error is a structured API error. Callers can errors.As it to inspect the HTTP status; its message is the human-readable rendering.

func (*Error) Error

func (e *Error) Error() string

Jump to

Keyboard shortcuts

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