func (wh *WorkflowHandler) normalizeVersionedErrors(ctx context.Context, err error) error {
	switch err.(type) {
	case *types.WorkflowExecutionAlreadyCompletedError:
		call := yarpc.CallFromContext(ctx)
		clientFeatureVersion := call.Header(common.FeatureVersionHeaderName)
		clientImpl := call.Header(common.ClientImplHeaderName)
		featureFlags := client.GetFeatureFlagsFromHeader(call)

		vErr := wh.versionChecker.SupportsWorkflowAlreadyCompletedError(clientImpl, clientFeatureVersion, featureFlags)
		if vErr == nil {
			return err
		}
		return &types.EntityNotExistsError{Message: "Workflow execution already completed."}
	default:
		return err
	}
}
// Some error types are introduced later that some clients might not support
// To make them backward compatible, we continue returning the legacy error types
// for older clients
Some error types are introduced later that some clients might not support
To make them backward compatible, we continue returning the legacy error types
for older clients
// Some error types are introduced later that some clients might not support // To make them backward compatible we continue returning the legacy error types // for older clients
func (wh *WorkflowHandler) normalizeVersionedErrors(ctx context.Context, err error) error {
	switch err.(type) {
	case *types.WorkflowExecutionAlreadyCompletedError:
		call := yarpc.CallFromContext(ctx)
		clientFeatureVersion := call.Header(common.FeatureVersionHeaderName)
		clientImpl := call.Header(common.ClientImplHeaderName)
		featureFlags := client.GetFeatureFlagsFromHeader(call)
		vErr := wh.versionChecker.SupportsWorkflowAlreadyCompletedError(clientImpl, clientFeatureVersion, featureFlags)
		if vErr == nil {
			return err
		}
		return &types.EntityNotExistsError{Message: "Workflow execution already completed."}
	default:
		return err
	}
}
func ( wh * WorkflowHandler ) normalizeVersionedErrors ( ctx context . Context , err error ) error { switch err . ( type ) { case * types . WorkflowExecutionAlreadyCompletedError : call := yarpc . CallFromContext ( ctx ) clientFeatureVersion := call . Header ( common . FeatureVersionHeaderName ) clientImpl := call . Header ( common . ClientImplHeaderName ) featureFlags := client . GetFeatureFlagsFromHeader ( call ) vErr := wh . versionChecker . SupportsWorkflowAlreadyCompletedError ( clientImpl , clientFeatureVersion , featureFlags ) if vErr == nil { return err } return & types . EntityNotExistsError { Message : " " } default : return err } }
Some error types are introduced later that some clients might not support
To make them backward compatible, we continue returning the legacy error types
for older clients
Some error types are introduced later that some clients might not support To make them backward compatible we continue returning the legacy error types for older clients