arbiter-core-0.1.0.0
arbiter-core
Safe HaskellNone
LanguageGHC2024

Arbiter.Core.Exceptions

Description

Exceptions thrown by job handlers and by the worker engine.

JobException selects retry, DLQ, or tree/branch cancellation. JobNackException requests reprocessing without a recorded failure. Engine signals use separate exception types.

Synopsis

User-facing job decisions

data JobExceptionSource #

Decisions a handler can signal by throwing. The worker catches it and retries, dead-letters or cancels the job.

Constructors

Retryable JobRetryableException

Retries the job after its delay, or with backoff.

Permanent JobPermanentException

Moves the job to the DLQ.

TreeCancel TreeCancelException

Deletes the entire job tree from root to leaves.

BranchCancel BranchCancelException

Cancels the parent and every descendant. A job with no parent cancels only itself and its descendants.

data JobRetryableExceptionSource #

Transient failure. The job is retried after the delay in seconds, or with the pool's backoff when there is none.

Instances

Instances details
Eq JobRetryableException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

Exception JobRetryableException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

Generic JobRetryableException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

Associated Types

type Rep JobRetryableException 
Instance details

Defined in Arbiter.Core.Exceptions

type Rep JobRetryableException = D1 ('MetaData "JobRetryableException" "Arbiter.Core.Exceptions" "arbiter-core-0.1.0.0-inplace" 'False) (C1 ('MetaCons "JobRetryableException" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe NominalDiffTime))))
Show JobRetryableException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

type Rep JobRetryableException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

type Rep JobRetryableException = D1 ('MetaData "JobRetryableException" "Arbiter.Core.Exceptions" "arbiter-core-0.1.0.0-inplace" 'False) (C1 ('MetaCons "JobRetryableException" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe NominalDiffTime))))

newtype JobPermanentExceptionSource #

Permanent failure. The job goes straight to the DLQ.

Instances

Instances details
Eq JobPermanentException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

Exception JobPermanentException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

Generic JobPermanentException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

Associated Types

type Rep JobPermanentException 
Instance details

Defined in Arbiter.Core.Exceptions

type Rep JobPermanentException = D1 ('MetaData "JobPermanentException" "Arbiter.Core.Exceptions" "arbiter-core-0.1.0.0-inplace" 'True) (C1 ('MetaCons "JobPermanentException" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))
Show JobPermanentException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

type Rep JobPermanentException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

type Rep JobPermanentException = D1 ('MetaData "JobPermanentException" "Arbiter.Core.Exceptions" "arbiter-core-0.1.0.0-inplace" 'True) (C1 ('MetaCons "JobPermanentException" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

newtype TreeCancelExceptionSource #

Cancel the whole job tree, root to leaves.

Instances

Instances details
Eq TreeCancelException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

Exception TreeCancelException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

Generic TreeCancelException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

Associated Types

type Rep TreeCancelException 
Instance details

Defined in Arbiter.Core.Exceptions

type Rep TreeCancelException = D1 ('MetaData "TreeCancelException" "Arbiter.Core.Exceptions" "arbiter-core-0.1.0.0-inplace" 'True) (C1 ('MetaCons "TreeCancelException" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))
Show TreeCancelException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

type Rep TreeCancelException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

type Rep TreeCancelException = D1 ('MetaData "TreeCancelException" "Arbiter.Core.Exceptions" "arbiter-core-0.1.0.0-inplace" 'True) (C1 ('MetaCons "TreeCancelException" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

newtype BranchCancelExceptionSource #

Cancel the parent and every descendant. A job with no parent cancels only itself and its descendants. A grandparent above is resumed.

Instances

Instances details
Eq BranchCancelException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

Exception BranchCancelException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

Generic BranchCancelException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

Associated Types

type Rep BranchCancelException 
Instance details

Defined in Arbiter.Core.Exceptions

type Rep BranchCancelException = D1 ('MetaData "BranchCancelException" "Arbiter.Core.Exceptions" "arbiter-core-0.1.0.0-inplace" 'True) (C1 ('MetaCons "BranchCancelException" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))
Show BranchCancelException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

type Rep BranchCancelException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

type Rep BranchCancelException = D1 ('MetaData "BranchCancelException" "Arbiter.Core.Exceptions" "arbiter-core-0.1.0.0-inplace" 'True) (C1 ('MetaCons "BranchCancelException" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

newtype JobNackExceptionSource #

Reprocess the job later without recording a failure (a soft nack). The worker skips retry/DLQ, hands back the attempt the claim consumed, and leaves the job to become visible again after the delay in seconds, or when its lease lapses when there is none.

Instances

Instances details
Eq JobNackException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

Exception JobNackException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

Generic JobNackException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

Associated Types

type Rep JobNackException 
Instance details

Defined in Arbiter.Core.Exceptions

type Rep JobNackException = D1 ('MetaData "JobNackException" "Arbiter.Core.Exceptions" "arbiter-core-0.1.0.0-inplace" 'True) (C1 ('MetaCons "JobNackException" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe NominalDiffTime))))
Show JobNackException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

type Rep JobNackException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

type Rep JobNackException = D1 ('MetaData "JobNackException" "Arbiter.Core.Exceptions" "arbiter-core-0.1.0.0-inplace" 'True) (C1 ('MetaCons "JobNackException" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe NominalDiffTime))))

Engine-internal signals

newtype ParsingExceptionSource #

Row decoding failure (engine-internal). Classified as a permanent failure by the worker.

Constructors

ParsingException Text 

Instances

Instances details
Eq ParsingException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

Exception ParsingException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

Generic ParsingException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

Associated Types

type Rep ParsingException 
Instance details

Defined in Arbiter.Core.Exceptions

type Rep ParsingException = D1 ('MetaData "ParsingException" "Arbiter.Core.Exceptions" "arbiter-core-0.1.0.0-inplace" 'True) (C1 ('MetaCons "ParsingException" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))
Show ParsingException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

type Rep ParsingException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

type Rep ParsingException = D1 ('MetaData "ParsingException" "Arbiter.Core.Exceptions" "arbiter-core-0.1.0.0-inplace" 'True) (C1 ('MetaCons "ParsingException" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

newtype InternalExceptionSource #

Generic engine-internal failure, such as a missing connection or bad parameters.

Constructors

InternalException Text 

Instances

Instances details
Eq InternalException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

Exception InternalException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

Generic InternalException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

Associated Types

type Rep InternalException 
Instance details

Defined in Arbiter.Core.Exceptions

type Rep InternalException = D1 ('MetaData "InternalException" "Arbiter.Core.Exceptions" "arbiter-core-0.1.0.0-inplace" 'True) (C1 ('MetaCons "InternalException" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))
Show InternalException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

type Rep InternalException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

type Rep InternalException = D1 ('MetaData "InternalException" "Arbiter.Core.Exceptions" "arbiter-core-0.1.0.0-inplace" 'True) (C1 ('MetaCons "InternalException" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

data JobGoneExceptionSource #

Job was deleted or reclaimed between claim and ack. The worker recognizes this signal and skips retry/DLQ. The message is the reason reported to onJobUnavailable. The ids are the jobs that are gone. Empty when the thrower did not name them.

Constructors

JobGoneException Text [Int64] 

Instances

Instances details
Eq JobGoneException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

Exception JobGoneException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

Generic JobGoneException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

Associated Types

type Rep JobGoneException 
Instance details

Defined in Arbiter.Core.Exceptions

type Rep JobGoneException = D1 ('MetaData "JobGoneException" "Arbiter.Core.Exceptions" "arbiter-core-0.1.0.0-inplace" 'False) (C1 ('MetaCons "JobGoneException" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Int64])))
Show JobGoneException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

type Rep JobGoneException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

type Rep JobGoneException = D1 ('MetaData "JobGoneException" "Arbiter.Core.Exceptions" "arbiter-core-0.1.0.0-inplace" 'False) (C1 ('MetaCons "JobGoneException" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Int64])))

data JobForceCancelledSource #

Async exception for an operator force-cancel. Names the cancelled jobs, then the jobs the same check found reclaimed or gone.

Constructors

JobForceCancelled [Int64] [Int64] 

newtype JobDeadlineExceededSource #

A batch's claim hooks and handler ran past the pool's maximum job duration. Classified as a retryable failure.

Instances

Instances details
Eq JobDeadlineExceeded Source # 
Instance details

Defined in Arbiter.Core.Exceptions

Exception JobDeadlineExceeded Source # 
Instance details

Defined in Arbiter.Core.Exceptions

Generic JobDeadlineExceeded Source # 
Instance details

Defined in Arbiter.Core.Exceptions

Associated Types

type Rep JobDeadlineExceeded 
Instance details

Defined in Arbiter.Core.Exceptions

type Rep JobDeadlineExceeded = D1 ('MetaData "JobDeadlineExceeded" "Arbiter.Core.Exceptions" "arbiter-core-0.1.0.0-inplace" 'True) (C1 ('MetaCons "JobDeadlineExceeded" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))
Show JobDeadlineExceeded Source # 
Instance details

Defined in Arbiter.Core.Exceptions

type Rep JobDeadlineExceeded Source # 
Instance details

Defined in Arbiter.Core.Exceptions

type Rep JobDeadlineExceeded = D1 ('MetaData "JobDeadlineExceeded" "Arbiter.Core.Exceptions" "arbiter-core-0.1.0.0-inplace" 'True) (C1 ('MetaCons "JobDeadlineExceeded" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

Helpers

throwRetryable :: MonadIO m => Text -> m aSource #

Fail the job and let it retry.

throwRetryableAfter :: MonadIO m => NominalDiffTime -> Text -> m aSource #

Fail the job and retry it after a delay in seconds, in place of the pool's backoff. The failure uses an attempt.

throwPermanent :: MonadIO m => Text -> m aSource #

Fail the job straight to the DLQ.

throwTreeCancel :: MonadIO m => Text -> m aSource #

Cancel the whole job tree.

throwBranchCancel :: MonadIO m => Text -> m aSource #

Cancel the parent and every descendant. A job with no parent cancels only itself and its descendants.

throwNack :: MonadIO m => m aSource #

Return the job to the queue without consuming an attempt.

throwNackAfter :: MonadIO m => NominalDiffTime -> m aSource #

Return the job to the queue without consuming an attempt, visible again after a delay in seconds.

Internal

Internal to the arbiter packages. Not covered by the PVP.

throwParsing :: MonadIO m => Text -> m aSource #

Fail on an undecodable payload.

orThrowParsing :: MonadIO m => Either Text a -> m aSource #

The Right value, or throwParsing on the Left message.

throwInternal :: MonadIO m => Text -> m aSource #

Fail on an arbiter-internal error.

orThrowInternal :: MonadIO m => (e -> Text) -> Either e a -> m aSource #

The Right value, or throwInternal on the rendered Left.

throwJobGone :: MonadIO m => Text -> m aSource #

Signal that the claim is no longer valid, naming no ids.

throwJobGoneIds :: MonadIO m => Text -> [Int64] -> m aSource #

Throw JobGoneException naming the jobs that went away.

throwScopedFailure :: MonadIO m => JobException -> [Int64] -> m aSource #

Fail only the jobs named, leaving the rest of the batch its attempt.

namedJobIds :: [Int64] -> TextSource #

The ids a signal names, appended to its message. Empty when it names none.

displayEx :: SomeException -> TextSource #

An exception's inner message. It carries no backtrace.