You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by ro...@apache.org on 2018/12/14 04:03:38 UTC
[trafficcontrol] 03/04: Change unmarshal error to return the error
up instead of logging
This is an automated email from the ASF dual-hosted git repository.
rob pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
commit e5640d82c06329e06e37d3b8392216c30833e58f
Author: Evan Zelkowitz <19...@users.noreply.github.com>
AuthorDate: Wed Dec 12 11:04:28 2018 -0700
Change unmarshal error to return the error up instead of logging
---
traffic_monitor/towrap/towrap.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/traffic_monitor/towrap/towrap.go b/traffic_monitor/towrap/towrap.go
index f6a9d4d..d81ba69 100644
--- a/traffic_monitor/towrap/towrap.go
+++ b/traffic_monitor/towrap/towrap.go
@@ -331,8 +331,8 @@ func (s TrafficOpsSessionThreadsafe) trafficMonitorConfigMapRaw(cdn string) (*tc
log.Errorln("Error getting configMap from traffic_ops, backup file exists, reading from file")
json := jsoniter.ConfigFastest
- if err = json.Unmarshal(b, &configMap); err != nil {
- log.Errorln("Error unmarshaling JSON from TMConfigBackupFile")
+ if err := json.Unmarshal(b, &configMap); err != nil {
+ return nil, errors.New("unmarhsalling backup file monitoring.json: " + err.Error())
}
return configMap, err
}