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 is the decision a handler throws to say how its failure is settled. The options are retry, DLQ, or cancel the tree or branch. JobNackException asks for a reprocess with no failure recorded. The engine's own signals are separate types. A user handler does not throw them.

Synopsis

User-facing job decisions

Source #data JobException

Decisions a handler can signal by throwing. Caught by the worker to decide retry vs DLQ vs cancellation.

Constructors

Retryable JobRetryableException 
Permanent JobPermanentException 
TreeCancel TreeCancelException

Deletes the entire job tree from root to leaves.

BranchCancel BranchCancelException

Cascade-deletes the parent and all siblings.

Source #newtype JobRetryableException

Transient failure. The job is retried with backoff.

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" 'True) (C1 ('MetaCons "JobRetryableException" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))
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" 'True) (C1 ('MetaCons "JobRetryableException" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

Source #newtype JobPermanentException

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)))

Source #newtype TreeCancelException

Cancel a whole job tree, root to leaves, for a failure that invalidates all of it.

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)))

Source #newtype BranchCancelException

Cancel this branch, the parent and every sibling. A grandparent above it 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)))

Source #data JobNackException

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.

Constructors

JobNackException 

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" 'False) (C1 ('MetaCons "JobNackException" 'PrefixI 'False) (U1 :: Type -> Type))
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" 'False) (C1 ('MetaCons "JobNackException" 'PrefixI 'False) (U1 :: Type -> Type))

Engine-internal signals

Source #newtype ParsingException

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)))

Source #newtype InternalException

Generic engine-internal failure (e.g. missing connection, bad params).

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)))

Source #data JobGoneException

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])))

Source #data JobForceCancelled

Async exception for user-initiated force-cancel, naming the jobs it cancels and any the same check found reclaimed by another worker.

Constructors

JobForceCancelled [Int64] [Int64] 

Source #newtype JobDeadlineExceeded

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

Source #throwRetryable :: MonadIO m => Text -> m a

Fail the job and let it retry.

Source #throwPermanent :: MonadIO m => Text -> m a

Fail the job straight to the DLQ.

Source #throwTreeCancel :: MonadIO m => Text -> m a

Cancel the whole job tree.

Source #throwBranchCancel :: MonadIO m => Text -> m a

Cancel this job and its descendants.

Source #throwNack :: MonadIO m => m a

Return the job to the queue without consuming an attempt.

Source #throwParsing :: MonadIO m => Text -> m a

Fail on an undecodable payload.

Source #throwInternal :: MonadIO m => Text -> m a

Fail on an arbiter-internal error.

Source #throwJobGone :: MonadIO m => Text -> m a

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

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

Names the jobs that went away.

Source #namedJobIds :: [Int64] -> Text

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

Source #displayEx :: SomeException -> Text

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