MCPcopy Create free account
hub / github.com/caddyserver/caddy / APIError

Struct APIError

admin.go:1376–1380  ·  view source on GitHub ↗

APIError is a structured error that every API handler should return for consistency in logging and client responses. If Message is unset, then Err.Error() will be serialized in its place.

Source from the content-addressed store, hash-verified

1374// and client responses. If Message is unset, then
1375// Err.Error() will be serialized in its place.
1376type APIError struct {
1377 HTTPStatus int `json:"-"`
1378 Err error `json:"-"`
1379 Message string `json:"error"`
1380}
1381
1382func (e APIError) Error() string {
1383 if e.Err != nil {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected