Help us shape the future of Go! Take the 2026 Go Developer Survey

errors

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2020 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetErrorResponse

func SetErrorResponse(statusCode int, errorCode int, text string, c *gin.Context)

Return error response

func SetValidationErrorResponse

func SetValidationErrorResponse(err error, c *gin.Context)

Returns validation errors

Types

type Error

type Error struct {
	Code    int               `json:"code"`
	Message string            `json:"message"`
	Fields  map[string]string `json:"fields,omitempty"`
}

type Response

type Response struct {
	Error Error `json:"error"`
}

Jump to

Keyboard shortcuts

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