From 88e095f4062e698ec9f04ae420ef2ebe33087f90 Mon Sep 17 00:00:00 2001 From: Dennis Pattmann Date: Tue, 1 Dec 2020 19:53:36 +0100 Subject: [PATCH] fix: Return error if metric doesn't exists --- timestream.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/timestream.go b/timestream.go index e1e091b..46d84b7 100644 --- a/timestream.go +++ b/timestream.go @@ -132,6 +132,10 @@ func (t TimeSteamAdapter) readDimension(measureName string) (dimensions []string return } + if len(queryOutput.Rows) == 0 { + return nil, errors.New("No measure found") + } + for i, q := range queryOutput.ColumnInfo { if *q.Name == "dimensions" { for _, rv := range queryOutput.Rows[0].Data[i].ArrayValue {