package utils import ( "net/http" "gitea.pena/PenaSide/customer/internal/errors" ) var clientErrors = map[int]error{ http.StatusInternalServerError: errors.ErrInternalError, http.StatusBadRequest: errors.ErrInvalidArgs, http.StatusNotImplemented: errors.ErrMethodNotImplemented, http.StatusNotFound: errors.ErrNotFound, http.StatusForbidden: errors.ErrNoAccess, } func DetermineClientErrorResponse(statusCode int) error { err, ok := clientErrors[statusCode] if !ok { return errors.ErrInternalError } return err }