Skip to content

Commit

Permalink
fix: Return error if metric doesn't exists
Browse files Browse the repository at this point in the history
  • Loading branch information
dpattmann committed Dec 1, 2020
1 parent f644555 commit 88e095f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions timestream.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 88e095f

Please sign in to comment.