serviceerror

package
v1.36.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromStatus

func FromStatus(st *status.Status) error

FromStatus converts gRPC status to service error.

func NewActivityStartDuringTransition

func NewActivityStartDuringTransition() error

func NewCurrentBranchChanged

func NewCurrentBranchChanged(currentBranchToken, requestBranchToken []byte,
	currentVersionedTransition, requestVersionedTransition *persistencespb.VersionedTransition) error

NewCurrentBranchChanged returns new CurrentBranchChanged error. TODO: Update CurrentBranchChanged with event id and event version. Do not use branch token bytes as branch identity.

func NewInternalErrorWithDPanic

func NewInternalErrorWithDPanic(logger log.Logger, msg string) error

NewInternalErrorWithDPanic is a wrapper for service error that will panic if it's in dev environment

func NewObsoleteDispatchBuildId

func NewObsoleteDispatchBuildId(msg string) error

Deprecated. [cleanup-old-wv]

func NewObsoleteMatchingTask

func NewObsoleteMatchingTask(msg string) error

func NewObsoleteMatchingTaskf

func NewObsoleteMatchingTaskf(format string, args ...any) error

func NewRetryReplication

func NewRetryReplication(
	message string,
	namespaceId string,
	workflowId string,
	runId string,
	startEventId int64,
	startEventVersion int64,
	endEventId int64,
	endEventVersion int64,
) error

NewRetryReplication returns new RetryReplication error.

func NewShardOwnershipLost

func NewShardOwnershipLost(ownerHost string, currentHost string) error

NewShardOwnershipLost returns new ShardOwnershipLost error.

func NewStickyWorkerUnavailable

func NewStickyWorkerUnavailable() error

NewStickyWorkerUnavailable returns new StickyWorkerUnavailable error.

func NewSyncState

func NewSyncState(
	message string,
	namespaceId string,
	workflowId string,
	runId string,
	archetypeId uint32,
	versionedTransition *persistencespb.VersionedTransition,
	versionHistories *historyspb.VersionHistories,
) error

NewSyncState returns new SyncState error. nolint:staticcheck

func NewTaskAlreadyStarted

func NewTaskAlreadyStarted(taskType string) error

NewTaskAlreadyStarted returns new TaskAlreadyStarted error.

Types

type ActivityStartDuringTransition

type ActivityStartDuringTransition struct {
	Message string
	// contains filtered or unexported fields
}

ActivityStartDuringTransition when an activity start is rejected by History because the workflow is in a transitioning between worker deployments. When Matching sees this error it can safely drop the activity task because History will reschedule the activity task after the transition is complete.

func (*ActivityStartDuringTransition) Error

Error returns string message.

func (*ActivityStartDuringTransition) Status

type CurrentBranchChanged

type CurrentBranchChanged struct {
	Message                    string
	CurrentBranchToken         []byte
	RequestBranchToken         []byte
	CurrentVersionedTransition *persistencespb.VersionedTransition
	RequestVersionedTransition *persistencespb.VersionedTransition
	// contains filtered or unexported fields
}

CurrentBranchChanged represents current branch changed error.

func (*CurrentBranchChanged) Error

func (e *CurrentBranchChanged) Error() string

Error returns string message.

func (*CurrentBranchChanged) Status

func (e *CurrentBranchChanged) Status() *status.Status

type ObsoleteDispatchBuildId

type ObsoleteDispatchBuildId struct {
	Message string
	// contains filtered or unexported fields
}

ObsoleteDispatchBuildId happens when matching wants to dispatch task to an obsolete build ID. This is expected to happen when a workflow has concurrent tasks (and in some other edge cases) and redirect rules apply to the WF. In that case, tasks already scheduled but not started will become invalid and History reschedules them in the new build ID. Matching will still try dispatching the old tasks but it will face this error. Matching can safely drop tasks which face this error. Deprecated. [cleanup-old-wv]

func (*ObsoleteDispatchBuildId) Error

func (e *ObsoleteDispatchBuildId) Error() string

Error returns string message.

func (*ObsoleteDispatchBuildId) Status

func (e *ObsoleteDispatchBuildId) Status() *status.Status

type ObsoleteMatchingTask

type ObsoleteMatchingTask struct {
	Message string
	// contains filtered or unexported fields
}

ObsoleteMatchingTask happens when History determines a task that Matching wants to dispatch is no longer valid. Some examples:

  • WFT belongs to a sticky queue but the workflow is not on that sticky queue anymore.
  • WFT belongs to the normal queue but no the workflow is on a sticky queue.
  • WFT options were updated and the task was rescheduled
  • WF or activity task wants to start but their schedule time directive deployment no longer matched the workflows effective deployment.

When Matching receives this error it can safely drop the task because History has already scheduled new Matching tasks on the right task queue and deployment.

func (*ObsoleteMatchingTask) Error

func (e *ObsoleteMatchingTask) Error() string

Error returns string message.

func (*ObsoleteMatchingTask) Status

func (e *ObsoleteMatchingTask) Status() *status.Status

type RetryReplication

type RetryReplication struct {
	Message           string
	NamespaceId       string
	WorkflowId        string
	RunId             string
	StartEventId      int64
	StartEventVersion int64
	EndEventId        int64
	EndEventVersion   int64
	// contains filtered or unexported fields
}

RetryReplication represents retry task v2 error.

func (*RetryReplication) Equal

func (e *RetryReplication) Equal(err *RetryReplication) bool

func (*RetryReplication) Error

func (e *RetryReplication) Error() string

Error returns string message.

func (*RetryReplication) Status

func (e *RetryReplication) Status() *status.Status

type ShardOwnershipLost

type ShardOwnershipLost struct {
	Message     string
	OwnerHost   string
	CurrentHost string
	// contains filtered or unexported fields
}

ShardOwnershipLost represents shard ownership lost error.

func (*ShardOwnershipLost) Error

func (e *ShardOwnershipLost) Error() string

Error returns string message.

func (*ShardOwnershipLost) Status

func (e *ShardOwnershipLost) Status() *status.Status

type StickyWorkerUnavailable

type StickyWorkerUnavailable struct {
	Message string
	// contains filtered or unexported fields
}

StickyWorkerUnavailable represents sticky worker unavailable error.

func (*StickyWorkerUnavailable) Error

func (e *StickyWorkerUnavailable) Error() string

Error returns string message.

func (*StickyWorkerUnavailable) Status

func (e *StickyWorkerUnavailable) Status() *status.Status

type SyncState

type SyncState struct {
	Message             string
	NamespaceId         string
	WorkflowId          string
	RunId               string
	ArchetypeId         uint32
	VersionedTransition *persistencespb.VersionedTransition
	VersionHistories    *historyspb.VersionHistories
	// contains filtered or unexported fields
}

SyncState represents sync state error. nolint:staticcheck

func (*SyncState) Equal

func (e *SyncState) Equal(err *SyncState) bool

func (*SyncState) Error

func (e *SyncState) Error() string

Error returns string message.

func (*SyncState) Status

func (e *SyncState) Status() *status.Status

type TaskAlreadyStarted

type TaskAlreadyStarted struct {
	Message string
	// contains filtered or unexported fields
}

TaskAlreadyStarted represents task already started error.

func (*TaskAlreadyStarted) Error

func (e *TaskAlreadyStarted) Error() string

Error returns string message.

func (*TaskAlreadyStarted) Status

func (e *TaskAlreadyStarted) Status() *status.Status

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL