| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
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
- data JobException
- data JobRetryableException = JobRetryableException Text (Maybe NominalDiffTime)
- newtype JobPermanentException = JobPermanentException Text
- newtype TreeCancelException = TreeCancelException Text
- newtype BranchCancelException = BranchCancelException Text
- newtype JobNackException = JobNackException (Maybe NominalDiffTime)
- newtype ParsingException = ParsingException Text
- newtype InternalException = InternalException Text
- data JobGoneException = JobGoneException Text [Int64]
- data JobScopedFailure = JobScopedFailure JobException [Int64]
- data JobForceCancelled = JobForceCancelled [Int64] [Int64]
- newtype JobDeadlineExceeded = JobDeadlineExceeded Text
- throwRetryable :: MonadIO m => Text -> m a
- throwRetryableAfter :: MonadIO m => NominalDiffTime -> Text -> m a
- throwPermanent :: MonadIO m => Text -> m a
- throwTreeCancel :: MonadIO m => Text -> m a
- throwBranchCancel :: MonadIO m => Text -> m a
- throwNack :: MonadIO m => m a
- throwNackAfter :: MonadIO m => NominalDiffTime -> m a
- throwParsing :: MonadIO m => Text -> m a
- orThrowParsing :: MonadIO m => Either Text a -> m a
- throwInternal :: MonadIO m => Text -> m a
- orThrowInternal :: MonadIO m => (e -> Text) -> Either e a -> m a
- throwJobGone :: MonadIO m => Text -> m a
- throwJobGoneIds :: MonadIO m => Text -> [Int64] -> m a
- throwScopedFailure :: MonadIO m => JobException -> [Int64] -> m a
- namedJobIds :: [Int64] -> Text
- displayEx :: SomeException -> Text
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. |
Instances
| Exception JobException Source # | |
Defined in Arbiter.Core.Exceptions Methods toException :: JobException -> SomeException# fromException :: SomeException -> Maybe JobException# | |
| Show JobException Source # | |
Defined in Arbiter.Core.Exceptions Methods showsPrec :: Int -> JobException -> ShowS# show :: JobException -> String# showList :: [JobException] -> ShowS# | |
data JobRetryableExceptionSource #
Transient failure. The job is retried after the delay in seconds, or with the pool's backoff when there is none.
Constructors
| JobRetryableException Text (Maybe NominalDiffTime) |
Instances
newtype JobPermanentExceptionSource #
Permanent failure. The job goes straight to the DLQ.
Constructors
| JobPermanentException Text |
Instances
| Eq JobPermanentException Source # | |||||
Defined in Arbiter.Core.Exceptions Methods (==) :: JobPermanentException -> JobPermanentException -> Bool# (/=) :: JobPermanentException -> JobPermanentException -> Bool# | |||||
| Exception JobPermanentException Source # | |||||
Defined in Arbiter.Core.Exceptions | |||||
| Generic JobPermanentException Source # | |||||
Defined in Arbiter.Core.Exceptions Associated Types
Methods from :: JobPermanentException -> Rep JobPermanentException x# | |||||
| Show JobPermanentException Source # | |||||
Defined in Arbiter.Core.Exceptions Methods showsPrec :: Int -> JobPermanentException -> ShowS# show :: JobPermanentException -> String# showList :: [JobPermanentException] -> ShowS# | |||||
| type Rep JobPermanentException Source # | |||||
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.
Constructors
| TreeCancelException Text |
Instances
| Eq TreeCancelException Source # | |||||
Defined in Arbiter.Core.Exceptions Methods (==) :: TreeCancelException -> TreeCancelException -> Bool# (/=) :: TreeCancelException -> TreeCancelException -> Bool# | |||||
| Exception TreeCancelException Source # | |||||
Defined in Arbiter.Core.Exceptions | |||||
| Generic TreeCancelException Source # | |||||
Defined in Arbiter.Core.Exceptions Associated Types
Methods from :: TreeCancelException -> Rep TreeCancelException x# to :: Rep TreeCancelException x -> TreeCancelException# | |||||
| Show TreeCancelException Source # | |||||
Defined in Arbiter.Core.Exceptions Methods showsPrec :: Int -> TreeCancelException -> ShowS# show :: TreeCancelException -> String# showList :: [TreeCancelException] -> ShowS# | |||||
| type Rep TreeCancelException Source # | |||||
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.
Constructors
| BranchCancelException Text |
Instances
| Eq BranchCancelException Source # | |||||
Defined in Arbiter.Core.Exceptions Methods (==) :: BranchCancelException -> BranchCancelException -> Bool# (/=) :: BranchCancelException -> BranchCancelException -> Bool# | |||||
| Exception BranchCancelException Source # | |||||
Defined in Arbiter.Core.Exceptions | |||||
| Generic BranchCancelException Source # | |||||
Defined in Arbiter.Core.Exceptions Associated Types
Methods from :: BranchCancelException -> Rep BranchCancelException x# | |||||
| Show BranchCancelException Source # | |||||
Defined in Arbiter.Core.Exceptions Methods showsPrec :: Int -> BranchCancelException -> ShowS# show :: BranchCancelException -> String# showList :: [BranchCancelException] -> ShowS# | |||||
| type Rep BranchCancelException Source # | |||||
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.
Constructors
| JobNackException (Maybe NominalDiffTime) |
Instances
| Eq JobNackException Source # | |||||
Defined in Arbiter.Core.Exceptions Methods (==) :: JobNackException -> JobNackException -> Bool# (/=) :: JobNackException -> JobNackException -> Bool# | |||||
| Exception JobNackException Source # | |||||
Defined in Arbiter.Core.Exceptions | |||||
| Generic JobNackException Source # | |||||
Defined in Arbiter.Core.Exceptions Associated Types
Methods from :: JobNackException -> Rep JobNackException x# to :: Rep JobNackException x -> JobNackException# | |||||
| Show JobNackException Source # | |||||
Defined in Arbiter.Core.Exceptions Methods showsPrec :: Int -> JobNackException -> ShowS# show :: JobNackException -> String# showList :: [JobNackException] -> ShowS# | |||||
| type Rep JobNackException Source # | |||||
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
| Eq ParsingException Source # | |||||
Defined in Arbiter.Core.Exceptions Methods (==) :: ParsingException -> ParsingException -> Bool# (/=) :: ParsingException -> ParsingException -> Bool# | |||||
| Exception ParsingException Source # | |||||
Defined in Arbiter.Core.Exceptions | |||||
| Generic ParsingException Source # | |||||
Defined in Arbiter.Core.Exceptions Associated Types
Methods from :: ParsingException -> Rep ParsingException x# to :: Rep ParsingException x -> ParsingException# | |||||
| Show ParsingException Source # | |||||
Defined in Arbiter.Core.Exceptions Methods showsPrec :: Int -> ParsingException -> ShowS# show :: ParsingException -> String# showList :: [ParsingException] -> ShowS# | |||||
| type Rep ParsingException Source # | |||||
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
| Eq InternalException Source # | |||||
Defined in Arbiter.Core.Exceptions Methods (==) :: InternalException -> InternalException -> Bool# (/=) :: InternalException -> InternalException -> Bool# | |||||
| Exception InternalException Source # | |||||
Defined in Arbiter.Core.Exceptions | |||||
| Generic InternalException Source # | |||||
Defined in Arbiter.Core.Exceptions Associated Types
Methods from :: InternalException -> Rep InternalException x# to :: Rep InternalException x -> InternalException# | |||||
| Show InternalException Source # | |||||
Defined in Arbiter.Core.Exceptions Methods showsPrec :: Int -> InternalException -> ShowS# show :: InternalException -> String# showList :: [InternalException] -> ShowS# | |||||
| type Rep InternalException Source # | |||||
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
| Eq JobGoneException Source # | |||||
Defined in Arbiter.Core.Exceptions Methods (==) :: JobGoneException -> JobGoneException -> Bool# (/=) :: JobGoneException -> JobGoneException -> Bool# | |||||
| Exception JobGoneException Source # | |||||
Defined in Arbiter.Core.Exceptions | |||||
| Generic JobGoneException Source # | |||||
Defined in Arbiter.Core.Exceptions Associated Types
Methods from :: JobGoneException -> Rep JobGoneException x# to :: Rep JobGoneException x -> JobGoneException# | |||||
| Show JobGoneException Source # | |||||
Defined in Arbiter.Core.Exceptions Methods showsPrec :: Int -> JobGoneException -> ShowS# show :: JobGoneException -> String# showList :: [JobGoneException] -> ShowS# | |||||
| type Rep JobGoneException Source # | |||||
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 JobScopedFailureSource #
A failure that settles the jobs it names and no others.
Constructors
| JobScopedFailure JobException [Int64] |
Instances
| Exception JobScopedFailure Source # | |
Defined in Arbiter.Core.Exceptions | |
| Show JobScopedFailure Source # | |
Defined in Arbiter.Core.Exceptions Methods showsPrec :: Int -> JobScopedFailure -> ShowS# show :: JobScopedFailure -> String# showList :: [JobScopedFailure] -> ShowS# | |
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] |
Instances
| Exception JobForceCancelled Source # | |
Defined in Arbiter.Core.Exceptions | |
| Show JobForceCancelled Source # | |
Defined in Arbiter.Core.Exceptions Methods showsPrec :: Int -> JobForceCancelled -> ShowS# show :: JobForceCancelled -> String# showList :: [JobForceCancelled] -> ShowS# | |
newtype JobDeadlineExceededSource #
A batch's claim hooks and handler ran past the pool's maximum job duration. Classified as a retryable failure.
Constructors
| JobDeadlineExceeded Text |
Instances
| Eq JobDeadlineExceeded Source # | |||||
Defined in Arbiter.Core.Exceptions Methods (==) :: JobDeadlineExceeded -> JobDeadlineExceeded -> Bool# (/=) :: JobDeadlineExceeded -> JobDeadlineExceeded -> Bool# | |||||
| Exception JobDeadlineExceeded Source # | |||||
Defined in Arbiter.Core.Exceptions | |||||
| Generic JobDeadlineExceeded Source # | |||||
Defined in Arbiter.Core.Exceptions Associated Types
Methods from :: JobDeadlineExceeded -> Rep JobDeadlineExceeded x# to :: Rep JobDeadlineExceeded x -> JobDeadlineExceeded# | |||||
| Show JobDeadlineExceeded Source # | |||||
Defined in Arbiter.Core.Exceptions Methods showsPrec :: Int -> JobDeadlineExceeded -> ShowS# show :: JobDeadlineExceeded -> String# showList :: [JobDeadlineExceeded] -> ShowS# | |||||
| type Rep JobDeadlineExceeded Source # | |||||
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.
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.