errors

package
v0.184.52 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateErrorResponseFromError

func CreateErrorResponseFromError(err error) error

CreateErrorResponseFromError creates an ErrorResponse from a generic error.

func DetailsFromError added in v0.184.48

func DetailsFromError(err error) string

DetailsFromError returns the details from an error.

func IsErrorResponse added in v0.182.38

func IsErrorResponse(err error) bool

IsErrorResponse determines if an error is an ErrorResponse.

Types

type ErrorCode

type ErrorCode string

ErrorCode represents a specific error code.

const GenericErrorCode ErrorCode = "0"

func ErrorCodeFromError added in v0.184.48

func ErrorCodeFromError(err error) ErrorCode

ErrorCodeFromError returns the ErrorCode from an error.

type ErrorResponse

type ErrorResponse struct {
	Code    ErrorCode `json:"code"`
	Details string    `json:"details,omitempty"`
}

ErrorResponse represents an error response structure.

func (*ErrorResponse) Error

func (e *ErrorResponse) Error() string

Error implements the error interface for ErrorResponse.

Jump to

Keyboard shortcuts

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