apierrors

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2025 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Message     string
	StatusCode  int
	Body        string
	RawResponse *http.Response
}

func NewAPIError

func NewAPIError(message string, statusCode int, body string, httpRes *http.Response) *APIError

func (*APIError) Error

func (e *APIError) Error() string

type ErrorResponse

type ErrorResponse struct {
	// The status code of the error message. This is always the same code as the status code of the HTTP message itself.
	Status int64 `json:"status"`
	// The HTTP reason phrase of the error. For example, for a `404` error, the `title` will be `Not Found`.
	Title string `json:"title"`
	// A detailed human-readable description of the error that occurred.
	Detail string `json:"detail"`
	// If the error was caused by a value provided by you in a specific field, the `field` property will contain the name
	// of the field that caused the issue.
	Field    *string                       `json:"field,omitempty"`
	Links    components.ErrorResponseLinks `json:"_links"`
	HTTPMeta components.HTTPMetadata       `json:"-"`
}

ErrorResponse - An error response object.

func (*ErrorResponse) Error

func (e *ErrorResponse) Error() string

Jump to

Keyboard shortcuts

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