Skip to content

Commit

Permalink
Fix log message. (#77)
Browse files Browse the repository at this point in the history
Fix error handling and messages for Search Attributes.
  • Loading branch information
robholland authored Feb 15, 2024
1 parent d99355b commit 98efd24
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions scenarios/throughput_stress.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,16 @@ func (t *tpsExecutor) Run(ctx context.Context, info loadgen.ScenarioInfo) error
var deniedErr *serviceerror.PermissionDenied
var alreadyErr *serviceerror.AlreadyExists

if errors.As(err, &deniedErr) {
if errors.As(err, &alreadyErr) {
info.Logger.Infof("Search Attribute %s already exists", ThroughputStressScenarioIdSearchAttribute)
} else if err != nil {
info.Logger.Warnf("Failed to add Search Attribute %s: %v", ThroughputStressScenarioIdSearchAttribute, err)
} else if !errors.As(err, &alreadyErr) {
info.Logger.Info("Search Attribute %s already exists", ThroughputStressScenarioIdSearchAttribute)

return err
if !errors.As(err, &deniedErr) {
return err
}
} else {
info.Logger.Info("Search Attribute %s added", ThroughputStressScenarioIdSearchAttribute)
info.Logger.Infof("Search Attribute %s added", ThroughputStressScenarioIdSearchAttribute)
}

// Complain if there are already existing workflows with the provided run id
Expand Down

0 comments on commit 98efd24

Please sign in to comment.