CloudWatch: Handle permissions error and update docs (#88524)
This commit is contained in:
@@ -35,6 +35,10 @@ func (e *cloudWatchExecutor) parseResponse(ctx context.Context, startTime time.T
|
||||
dataRes.Error = fmt.Errorf("ArithmeticError in query %q: %s", queryRow.RefId, response.ArithmeticErrorMessage)
|
||||
}
|
||||
|
||||
if response.HasPermissionError {
|
||||
dataRes.Error = fmt.Errorf("PermissionError in query %q: %s", queryRow.RefId, response.PermissionErrorMessage)
|
||||
}
|
||||
|
||||
var err error
|
||||
dataRes.Frames, err = buildDataFrames(ctx, startTime, endTime, response, queryRow)
|
||||
if err != nil {
|
||||
@@ -79,6 +83,9 @@ func aggregateResponse(getMetricDataOutputs []*cloudwatch.GetMetricDataOutput) m
|
||||
if *message.Code == "ArithmeticError" {
|
||||
response.AddArithmeticError(message.Value)
|
||||
}
|
||||
if *message.Code == "Forbidden" {
|
||||
response.AddPermissionError(message.Value)
|
||||
}
|
||||
}
|
||||
|
||||
response.AddMetricDataResult(r)
|
||||
|
||||
Reference in New Issue
Block a user