You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by oc...@apache.org on 2021/01/11 23:09:04 UTC

[trafficcontrol] branch master updated: Fixed error message when creating a new cachegroup with missing type (#5421)

This is an automated email from the ASF dual-hosted git repository.

ocket8888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git


The following commit(s) were added to refs/heads/master by this push:
     new 0ad2086  Fixed error message when creating a new cachegroup with missing type (#5421)
0ad2086 is described below

commit 0ad20867099f1d89881249c29108c35cfe69a52b
Author: rimashah25 <22...@users.noreply.github.com>
AuthorDate: Mon Jan 11 16:08:51 2021 -0700

    Fixed error message when creating a new cachegroup with missing type (#5421)
    
    * Fixed error message in types.go file
    
    * Formatting
---
 CHANGELOG.md       | 1 +
 lib/go-tc/types.go | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 83519a2..39f21b1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
 - Traffic Ops: Added validation to ensure that the cachegroups of a delivery services' assigned ORG servers are present in the topology
 
 ### Fixed
+- [#5287](https://github.com/apache/trafficcontrol/issues/5287) - Fixed error message when creating a Cache Group with no typeId
 - [#5382](https://github.com/apache/trafficcontrol/issues/5382) - Fixed API documentation and TP helptext for "Max DNS Answers" field with respect to DNS, HTTP, Steering Delivery Service
 - [#5396](https://github.com/apache/trafficcontrol/issues/5396) - Return the correct error type if user tries to update the root tenant
 - [#5378](https://github.com/apache/trafficcontrol/issues/5378) - Updating a non existent DS should return a 404, instead of a 500
diff --git a/lib/go-tc/types.go b/lib/go-tc/types.go
index f13e936..3f77033 100644
--- a/lib/go-tc/types.go
+++ b/lib/go-tc/types.go
@@ -69,7 +69,7 @@ func GetTypeData(tx *sql.Tx, id int) (string, string, bool, error) {
 // returns "" and an error if the typeID is invalid. If valid, the type's name is returned.
 func ValidateTypeID(tx *sql.Tx, typeID *int, expectedUseInTable string) (string, error) {
 	if typeID == nil {
-		return "", errors.New("missing type")
+		return "", errors.New("missing property: 'typeId'")
 	}
 
 	typeName, useInTable, ok, err := GetTypeData(tx, *typeID)