Skip to content

Commit c6bfb60

Browse files
authored
Don't mention MultiOperation in Update-with-Start error (#7826)
## What changed? Always say "Update-with-Start" in the error message returned to the user when using MultiOperations. (internally, History will still use MultiOperation in the error messages) ## Why? Users wouldn't (and shouldn't) know that Update-with-Start happens to be a MultiOperation. ## How did you test it? - [ ] built - [ ] run locally and tested manually - [x] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) ## Potential risks I don't expect any users to match on that string. There might be SDK tests that break now; I'll have to follow up on that.
1 parent 5416e0f commit c6bfb60

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

service/frontend/workflow_handler.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -545,9 +545,9 @@ func (wh *WorkflowHandler) ExecuteMultiOperation(
545545
if err != nil {
546546
var multiErr *serviceerror.MultiOperationExecution
547547
if errors.As(err, &multiErr) {
548-
// Trim error message for end-users.
548+
// Tweak error message for end-users to match the feature name.
549549
// The per-operation errors are embedded inside the error and unpacked by the SDK.
550-
multiErr.Message = "MultiOperation could not be executed."
550+
multiErr.Message = "Update-with-Start could not be executed."
551551
}
552552
return nil, err
553553
}
@@ -590,7 +590,7 @@ func (wh *WorkflowHandler) convertToHistoryMultiOperationRequest(
590590
}
591591

592592
if hasError {
593-
return nil, serviceerror.NewMultiOperationExecution("MultiOperation could not be executed.", errs)
593+
return nil, serviceerror.NewMultiOperationExecution("Update-with-Start could not be executed.", errs)
594594
}
595595

596596
return &historyservice.ExecuteMultiOperationRequest{

service/frontend/workflow_handler_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3401,7 +3401,7 @@ func (s *WorkflowHandlerSuite) TestExecuteMultiOperation() {
34013401
})
34023402

34033403
assertMultiOpsErr := func(expectedErrs []error, actual error) {
3404-
s.Equal("MultiOperation could not be executed.", actual.Error())
3404+
s.Equal("Update-with-Start could not be executed.", actual.Error())
34053405
s.EqualValues(expectedErrs, actual.(*serviceerror.MultiOperationExecution).OperationErrors())
34063406
}
34073407

tests/update_workflow_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5309,7 +5309,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWithStart() {
53095309
uwsCh := sendUpdateWithStart(testcore.NewContext(), startReq, updateReq)
53105310
uwsRes := <-uwsCh
53115311
s.Error(uwsRes.err)
5312-
s.Equal("MultiOperation could not be executed.", uwsRes.err.Error())
5312+
s.Equal("Update-with-Start could not be executed.", uwsRes.err.Error())
53135313
errs := uwsRes.err.(*serviceerror.MultiOperationExecution).OperationErrors()
53145314
s.Len(errs, 2)
53155315
var alreadyStartedErr *serviceerror.WorkflowExecutionAlreadyStarted
@@ -5488,7 +5488,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWithStart() {
54885488

54895489
uwsRes := <-uwsCh
54905490
s.Error(uwsRes.err)
5491-
s.Equal("MultiOperation could not be executed.", uwsRes.err.Error())
5491+
s.Equal("Update-with-Start could not be executed.", uwsRes.err.Error())
54925492
errs := uwsRes.err.(*serviceerror.MultiOperationExecution).OperationErrors()
54935493
s.Len(errs, 2)
54945494
s.Contains(errs[0].Error(), "Workflow execution already finished")

0 commit comments

Comments
 (0)