func FromError()

in common/types/mapper/thrift/errors.go [30:81]


func FromError(err error) error {
	if err == nil {
		return nil
	}

	switch e := err.(type) {
	case *types.AccessDeniedError:
		return FromAccessDeniedError(e)
	case *types.BadRequestError:
		return FromBadRequestError(e)
	case *types.CancellationAlreadyRequestedError:
		return FromCancellationAlreadyRequestedError(e)
	case *types.ClientVersionNotSupportedError:
		return FromClientVersionNotSupportedError(e)
	case *types.FeatureNotEnabledError:
		return FromFeatureNotEnabledError(e)
	case *types.CurrentBranchChangedError:
		return FromCurrentBranchChangedError(e)
	case *types.DomainAlreadyExistsError:
		return FromDomainAlreadyExistsError(e)
	case *types.DomainNotActiveError:
		return FromDomainNotActiveError(e)
	case *types.EntityNotExistsError:
		return FromEntityNotExistsError(e)
	case *types.WorkflowExecutionAlreadyCompletedError:
		return FromWorkflowExecutionAlreadyCompletedError(e)
	case *types.InternalDataInconsistencyError:
		return FromInternalDataInconsistencyError(e)
	case *types.InternalServiceError:
		return FromInternalServiceError(e)
	case *types.LimitExceededError:
		return FromLimitExceededError(e)
	case *types.QueryFailedError:
		return FromQueryFailedError(e)
	case *types.RemoteSyncMatchedError:
		return FromRemoteSyncMatchedError(e)
	case *types.RetryTaskV2Error:
		return FromRetryTaskV2Error(e)
	case *types.ServiceBusyError:
		return FromServiceBusyError(e)
	case *types.WorkflowExecutionAlreadyStartedError:
		return FromWorkflowExecutionAlreadyStartedError(e)
	case *types.ShardOwnershipLostError:
		return FromShardOwnershipLostError(e)
	case *types.EventAlreadyStartedError:
		return FromEventAlreadyStartedError(e)
	case *types.StickyWorkerUnavailableError:
		return FromStickyWorkerUnavailableError(e)
	default:
		return err
	}
}