errors

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abort

func Abort(c *gin.Context, err *HTTPError, requestId string)

Types

type ErrorResponse

type ErrorResponse struct {
	Timestamp string `json:"timestamp"`
	Status    int    `json:"status"`
	Error     string `json:"error"`
	Code      string `json:"code,omitempty"`
	Message   string `json:"message"`
	Path      string `json:"path"`
	RequestID string `json:"requestId,omitempty"`
}

func BuildResponse

func BuildResponse(path, requestID string, status int, code string, message string) ErrorResponse

type HTTPError

type HTTPError struct {
	Status  int
	Code    string
	Message string
}

func BadRequest

func BadRequest(message string) *HTTPError

func Conflict

func Conflict(message string) *HTTPError

func Forbidden

func Forbidden(message string) *HTTPError

func InternalServerError

func InternalServerError(message string) *HTTPError

func New

func New(status int, code string, message string) *HTTPError

func NotFound

func NotFound(message string) *HTTPError

func Unauthorized

func Unauthorized(message string) *HTTPError

Jump to

Keyboard shortcuts

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