Skip to content
This repository was archived by the owner on Dec 1, 2018. It is now read-only.

Commit 2c22636

Browse files
authored
Merge pull request #1829 from x13n/release-1.4
Bugfix: properly handle marshalJSON errors
2 parents 317a883 + 455b652 commit 2c22636

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

metrics/sinks/stackdriver/stackdriver.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,9 @@ func (sink *StackdriverSink) requestSender(reqQueue chan *sd_api.CreateTimeSerie
306306
func marshalRequestAndLog(printer func([]byte), req *sd_api.CreateTimeSeriesRequest) {
307307
reqJson, errJson := json.Marshal(req)
308308
if errJson != nil {
309-
printer(reqJson)
310-
} else {
311309
glog.Errorf("Couldn't marshal Stackdriver request %v", errJson)
310+
} else {
311+
printer(reqJson)
312312
}
313313
}
314314

0 commit comments

Comments
 (0)