File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
service/worker/workerdeployment Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -541,6 +541,8 @@ func (d *ClientImpl) SetCurrentVersion(
541541 res .ConflictToken = details [0 ].GetData ()
542542 }
543543 return & res , nil
544+ } else if failure := outcome .GetFailure (); failure .GetApplicationFailureInfo ().GetType () == errVersionNotFound {
545+ return nil , serviceerror .NewNotFound (errVersionNotFound )
544546 } else if failure .GetApplicationFailureInfo ().GetType () == errFailedPrecondition {
545547 return nil , serviceerror .NewFailedPrecondition (failure .Message )
546548 } else if failure != nil {
@@ -630,6 +632,8 @@ func (d *ClientImpl) SetRampingVersion(
630632 }
631633
632634 return & res , nil
635+ } else if failure := outcome .GetFailure (); failure .GetApplicationFailureInfo ().GetType () == errVersionNotFound {
636+ return nil , serviceerror .NewNotFound (errVersionNotFound )
633637 } else if failure .GetApplicationFailureInfo ().GetType () == errFailedPrecondition {
634638 return nil , serviceerror .NewFailedPrecondition (failure .Message )
635639 } else if failure != nil {
Original file line number Diff line number Diff line change @@ -416,7 +416,7 @@ func (d *WorkflowRunner) validateStateBeforeAcceptingRampingUpdate(args *deploym
416416
417417 if _ , ok := d .State .GetVersions ()[args .Version ]; ! ok && args .Version != "" && args .Version != worker_versioning .UnversionedVersionId {
418418 d .logger .Info ("version not found in deployment" )
419- return temporal .NewApplicationError (fmt .Sprintf ("requested ramping version %s not found in deployment" , args .Version ), errFailedPrecondition )
419+ return temporal .NewApplicationError (fmt .Sprintf ("requested ramping version %s not found in deployment" , args .Version ), errVersionNotFound )
420420 }
421421
422422 return nil
@@ -653,7 +653,7 @@ func (d *WorkflowRunner) validateStateBeforeAcceptingSetCurrent(args *deployment
653653 }
654654 if _ , ok := d .State .Versions [args .Version ]; ! ok && args .Version != worker_versioning .UnversionedVersionId {
655655 d .logger .Info ("version not found in deployment" )
656- return temporal .NewApplicationError (fmt .Sprintf ("version %s not found in deployment" , args .Version ), errFailedPrecondition )
656+ return temporal .NewApplicationError (fmt .Sprintf ("version %s not found in deployment" , args .Version ), errVersionNotFound )
657657 }
658658 return nil
659659}
You can’t perform that action at this time.
0 commit comments