| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
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
- data JobException
- newtype JobRetryableException = JobRetryableException Text
- newtype JobPermanentException = JobPermanentException Text
- newtype TreeCancelException = TreeCancelException Text
- newtype BranchCancelException = BranchCancelException Text
- data JobNackException = JobNackException
- newtype ParsingException = ParsingException Text
- newtype InternalException = InternalException Text
- data JobGoneException = JobGoneException Text [Int64]
- data JobForceCancelled = JobForceCancelled [Int64] [Int64]
- newtype JobDeadlineExceeded = JobDeadlineExceeded Text
- throwRetryable :: MonadIO m => 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
- throwParsing :: MonadIO m => Text -> m a
- throwInternal :: MonadIO m => Text -> m a
- throwJobGone :: MonadIO m => Text -> m a
- throwJobGoneIds :: MonadIO m => Text -> [Int64] -> m a
- namedJobIds :: [Int64] -> Text
- displayEx :: SomeException -> Text
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. |
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 | |
Source #newtype JobRetryableException
Transient failure. The job is retried with backoff.
Constructors
| JobRetryableException Text |
Instances
Source #newtype JobPermanentException
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))) | |||||
Source #newtype TreeCancelException
Cancel a whole job tree, root to leaves, for a failure that invalidates all of it.
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))) | |||||
Source #newtype BranchCancelException
Cancel this branch, the parent and every sibling. A grandparent above it 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))) | |||||
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
| 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 # | |||||
Engine-internal signals
Source #newtype ParsingException
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))) | |||||
Source #newtype InternalException
Generic engine-internal failure (e.g. missing connection, bad params).
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))) | |||||
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
| 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]))) | |||||
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] |
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 | |
Source #newtype JobDeadlineExceeded
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
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 #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 #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.