Browse Source

improve error message

Mitsuhiro Tanda 7 years ago
parent
commit
77220456b6
1 changed files with 4 additions and 0 deletions
  1. 4 0
      pkg/tsdb/cloudwatch/cloudwatch.go

+ 4 - 0
pkg/tsdb/cloudwatch/cloudwatch.go

@@ -112,6 +112,10 @@ func (e *CloudWatchExecutor) executeTimeSeriesQuery(ctx context.Context, queryCo
 			continue
 			continue
 		}
 		}
 
 
+		if query.Id == "" && query.Expression != "" {
+			return nil, fmt.Errorf("Invalid query: id should be set if using expression")
+		}
+
 		eg.Go(func() error {
 		eg.Go(func() error {
 			queryRes, err := e.executeQuery(ectx, query, queryContext)
 			queryRes, err := e.executeQuery(ectx, query, queryContext)
 			if err != nil {
 			if err != nil {