Commit aab920d6 authored by hammad zafar's avatar hammad zafar
Browse files

update error message details for unsuccessful json unmarshaling of request body in meep-vis

parent 8425e18a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -569,7 +569,7 @@ func predictedQosPost(w http.ResponseWriter, r *http.Request) {
	err := json.Unmarshal(bodyBytes, &requestData)
	if err != nil {
		log.Error(err.Error())
		errHandlerProblemDetails(w, "Request body is empty.", http.StatusBadRequest)
		errHandlerProblemDetails(w, "The request body is either empty or it's an invalid JSON.", http.StatusBadRequest)
		return
	}

+2 −1
Original line number Diff line number Diff line
@@ -824,7 +824,7 @@ func (tm *TrafficMgr) PredictQosPerTrafficLoad(hour int32, inRsrp int32, inRsrq
	var predictedUserTraffic int32

	var rows *sql.Rows
	log.Debug("Collecting traffic load pattern of POA %v for the time range: %v", poaName, timeRange)
	log.Debug("Collecting traffic load pattern of POA " + poaName + " for the time range: " + timeRange)
	rows, err = tm.db.Query(`SELECT "`+timeRange+`" FROM `+TrafficTable+` WHERE poa_name = ($1)`, poaName)
	if err != nil {
		log.Error(err)
@@ -906,6 +906,7 @@ func findReducedSignalStrength(inRsrp int32, inRsrq int32, users int32, averageL
		return redRsrp, redRsrq, nil

	} else {
		log.Debug("Number of users " + string(users) + " fall below the POA average, i.e.,  " + string(averageLoad))
		// no change in RSRP and RSRQ values
		return inRsrp, inRsrq, nil
	}