You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by mi...@apache.org on 2018/06/18 15:49:15 UTC

[trafficcontrol] branch master updated: Fix TO Go DS POST to 400 on duplicate, not 5xx.

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

mitchell852 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 035b40e  Fix TO Go DS POST to 400 on duplicate, not 5xx.
035b40e is described below

commit 035b40e1655c3a415b6543d41334ebb6a8adb5e8
Author: Robert Butts <ro...@apache.org>
AuthorDate: Sun Jun 10 10:56:55 2018 -0600

    Fix TO Go DS POST to 400 on duplicate, not 5xx.
---
 traffic_ops/traffic_ops_golang/deliveryservice/deliveryservicesv13.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/traffic_ops/traffic_ops_golang/deliveryservice/deliveryservicesv13.go b/traffic_ops/traffic_ops_golang/deliveryservice/deliveryservicesv13.go
index 77045f0..13fd993 100644
--- a/traffic_ops/traffic_ops_golang/deliveryservice/deliveryservicesv13.go
+++ b/traffic_ops/traffic_ops_golang/deliveryservice/deliveryservicesv13.go
@@ -202,7 +202,7 @@ func create(db *sql.DB, cfg config.Config, user *auth.CurrentUser, ds tc.Deliver
 	if err != nil {
 		if pqerr, ok := err.(*pq.Error); ok {
 			err, _ := dbhelpers.ParsePQUniqueConstraintError(pqerr)
-			return tc.DeliveryServiceNullableV13{}, http.StatusInternalServerError, nil, errors.New("a delivery service with " + err.Error())
+			return tc.DeliveryServiceNullableV13{}, http.StatusBadRequest, errors.New("a delivery service with " + err.Error()), nil
 		}
 		return tc.DeliveryServiceNullableV13{}, http.StatusInternalServerError, nil, errors.New("inserting ds: " + err.Error())
 	}

-- 
To stop receiving notification emails like this one, please contact
mitchell852@apache.org.