Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidRequest = NewAPIError(http.StatusBadRequest, "Invalid request") ErrForbidden = NewAPIError(http.StatusForbidden, "Forbidden") ErrNotFound = NewAPIError(http.StatusNotFound, "Resource not found") ErrInternal = NewAPIError(http.StatusInternalServerError, "Internal server error") )
Common API errors
Functions ¶
This section is empty.
Types ¶
type APIError ¶
type APIError struct { Code int `json:"code"` Message string `json:"message"` Details string `json:"details,omitempty"` }
APIError represents an error response from the API
func NewAPIError ¶
NewAPIError creates a new APIError
type ValidationError ¶
ValidationError represents a validation error
type ValidationErrors ¶
type ValidationErrors struct {
Errors []ValidationError `json:"errors"`
}
ValidationErrors represents multiple validation errors
func (*ValidationErrors) Error ¶
func (e *ValidationErrors) Error() string
Error implements the error interface
Click to show internal directories.
Click to hide internal directories.