// MapGRPCErrCodeToHTTPStatus MapGRPCErrCodeToHttpStatus Map GRPC errors codes to http status
MapGRPCErrCodeToHTTPStatus MapGRPCErrCodeToHttpStatus Map GRPC errors codes to http status
// MapGRPCErrCodeToHTTPStatus MapGRPCErrCodeToHttpStatus Map GRPC errors codes to http status
func MapGRPCErrCodeToHTTPStatus(code codes.Code) int {
	switch code {
	case codes.Unauthenticated:
		return http.StatusUnauthorized
	case codes.AlreadyExists:
		return http.StatusBadRequest
	case codes.NotFound:
		return http.StatusNotFound
	case codes.Internal:
		return http.StatusInternalServerError
	case codes.PermissionDenied:
		return http.StatusForbidden
	case codes.Canceled:
		return http.StatusRequestTimeout
	case codes.DeadlineExceeded:
		return http.StatusGatewayTimeout
	case codes.InvalidArgument:
		return http.StatusBadRequest
	}
	return http.StatusInternalServerError
}
func MapGRPCErrCodeToHTTPStatus ( code codes . Code ) int { switch code { case codes . Unauthenticated : return http . StatusUnauthorized case codes . AlreadyExists : return http . StatusBadRequest case codes . NotFound : return http . StatusNotFound case codes . Internal : return http . StatusInternalServerError case codes . PermissionDenied : return http . StatusForbidden case codes . Canceled : return http . StatusRequestTimeout case codes . DeadlineExceeded : return http . StatusGatewayTimeout case codes . InvalidArgument : return http . StatusBadRequest } return http . StatusInternalServerError }
MapGRPCErrCodeToHTTPStatus MapGRPCErrCodeToHttpStatus Map GRPC errors codes to http status
MapGRPCErrCodeToHTTPStatus MapGRPCErrCodeToHttpStatus Map GRPC errors codes to http status