S SmartDocs
Serie: Go go 8 righe · Aggiornato 2026-04-18

errors.go

Go/payment-gateway-challenge/internal/handlers/errors.go

package handlers

// ErrorJSON is the standard JSON envelope for non-2xx API errors documented in Swagger.
type ErrorJSON struct {
	Message string `json:"message" example:"failed to reach acquiring bank"`
	Detail  string `json:"detail,omitempty" example:"upstream body"`
	Status  int    `json:"status,omitempty" example:"502"`
}

Articoli correlati