| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Arbiter.Core.Exceptions
Description
Exceptions thrown by job handlers and by the worker engine.
JobException is the user-facing decision sum. A handler throws one of
these to signal how a failed job should be processed (retry, DLQ, cancel
the tree or branch).
The engine-internal exceptions (ParsingException, InternalException,
JobNotFoundException, JobStolenException) are thrown directly as
their own types, not wrapped in any sum. They are handled by the worker's
retry combinators and classifier, and are not part of the surface API
that user handlers throw.
Synopsis
- data JobException
- newtype JobRetryableException = JobRetryableException Text
- newtype JobPermanentException = JobPermanentException Text
- newtype TreeCancelException = TreeCancelException Text
- newtype BranchCancelException = BranchCancelException Text
- newtype ParsingException = ParsingException Text
- newtype InternalException = InternalException Text
- newtype JobNotFoundException = JobNotFoundException Text
- newtype JobStolenException = JobStolenException 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
- throwParsing :: MonadIO m => Text -> m a
- throwInternal :: MonadIO m => Text -> m a
- throwJobNotFound :: MonadIO m => Text -> m a
- throwJobStolen :: MonadIO m => Text -> m a
User-facing job decisions
data JobException Source #
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 # displayException :: JobException -> String # backtraceDesired :: JobException -> Bool # | |
| Show JobException Source # | |
Defined in Arbiter.Core.Exceptions Methods showsPrec :: Int -> JobException -> ShowS # show :: JobException -> String # showList :: [JobException] -> ShowS # | |
newtype JobRetryableException Source #
Transient failure - the job will be retried with backoff.
Constructors
| JobRetryableException Text |
Instances
newtype JobPermanentException Source #
Permanent failure - the job goes straight to the DLQ, no retries.
Constructors
| JobPermanentException Text |
Instances
| Exception JobPermanentException Source # | |||||
Defined in Arbiter.Core.Exceptions | |||||
| Generic JobPermanentException Source # | |||||
Defined in Arbiter.Core.Exceptions Associated Types
Methods from :: JobPermanentException -> Rep JobPermanentException x # to :: Rep JobPermanentException x -> JobPermanentException # | |||||
| Show JobPermanentException Source # | |||||
Defined in Arbiter.Core.Exceptions Methods showsPrec :: Int -> JobPermanentException -> ShowS # show :: JobPermanentException -> String # showList :: [JobPermanentException] -> ShowS # | |||||
| Eq JobPermanentException Source # | |||||
Defined in Arbiter.Core.Exceptions Methods (==) :: JobPermanentException -> JobPermanentException -> Bool # (/=) :: JobPermanentException -> JobPermanentException -> Bool # | |||||
| 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 TreeCancelException Source #
Cancels an entire job tree from root to leaves. Use when a failure invalidates all work in the tree.
Constructors
| TreeCancelException Text |
Instances
| 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 # | |||||
| Eq TreeCancelException Source # | |||||
Defined in Arbiter.Core.Exceptions Methods (==) :: TreeCancelException -> TreeCancelException -> Bool # (/=) :: TreeCancelException -> TreeCancelException -> Bool # | |||||
| 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 BranchCancelException Source #
Cancels the current branch (parent + all siblings). If the parent has a grandparent, the grandparent is resumed.
Constructors
| BranchCancelException Text |
Instances
| Exception BranchCancelException Source # | |||||
Defined in Arbiter.Core.Exceptions | |||||
| Generic BranchCancelException Source # | |||||
Defined in Arbiter.Core.Exceptions Associated Types
Methods from :: BranchCancelException -> Rep BranchCancelException x # to :: Rep BranchCancelException x -> BranchCancelException # | |||||
| Show BranchCancelException Source # | |||||
Defined in Arbiter.Core.Exceptions Methods showsPrec :: Int -> BranchCancelException -> ShowS # show :: BranchCancelException -> String # showList :: [BranchCancelException] -> ShowS # | |||||
| Eq BranchCancelException Source # | |||||
Defined in Arbiter.Core.Exceptions Methods (==) :: BranchCancelException -> BranchCancelException -> Bool # (/=) :: BranchCancelException -> BranchCancelException -> Bool # | |||||
| 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))) | |||||
Engine-internal signals
newtype ParsingException Source #
Row decoding failure (engine-internal). Classified as a permanent failure by the worker.
Constructors
| ParsingException Text |
Instances
| Exception ParsingException Source # | |||||
Defined in Arbiter.Core.Exceptions Methods toException :: ParsingException -> SomeException # fromException :: SomeException -> Maybe ParsingException # | |||||
| 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 # | |||||
| Eq ParsingException Source # | |||||
Defined in Arbiter.Core.Exceptions Methods (==) :: ParsingException -> ParsingException -> Bool # (/=) :: ParsingException -> ParsingException -> Bool # | |||||
| 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 InternalException Source #
Generic engine-internal failure (e.g. missing connection, bad params).
Constructors
| InternalException Text |
Instances
| Exception InternalException Source # | |||||
Defined in Arbiter.Core.Exceptions Methods toException :: InternalException -> SomeException # fromException :: SomeException -> Maybe InternalException # | |||||
| 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 # | |||||
| Eq InternalException Source # | |||||
Defined in Arbiter.Core.Exceptions Methods (==) :: InternalException -> InternalException -> Bool # (/=) :: InternalException -> InternalException -> Bool # | |||||
| 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))) | |||||
newtype JobNotFoundException Source #
Job was deleted or reclaimed between claim and ack. The worker recognizes
this signal via isJobGoneException and skips retry/DLQ.
Constructors
| JobNotFoundException Text |
Instances
| Exception JobNotFoundException Source # | |||||
Defined in Arbiter.Core.Exceptions | |||||
| Generic JobNotFoundException Source # | |||||
Defined in Arbiter.Core.Exceptions Associated Types
Methods from :: JobNotFoundException -> Rep JobNotFoundException x # to :: Rep JobNotFoundException x -> JobNotFoundException # | |||||
| Show JobNotFoundException Source # | |||||
Defined in Arbiter.Core.Exceptions Methods showsPrec :: Int -> JobNotFoundException -> ShowS # show :: JobNotFoundException -> String # showList :: [JobNotFoundException] -> ShowS # | |||||
| Eq JobNotFoundException Source # | |||||
Defined in Arbiter.Core.Exceptions Methods (==) :: JobNotFoundException -> JobNotFoundException -> Bool # (/=) :: JobNotFoundException -> JobNotFoundException -> Bool # | |||||
| type Rep JobNotFoundException Source # | |||||
Defined in Arbiter.Core.Exceptions type Rep JobNotFoundException = D1 ('MetaData "JobNotFoundException" "Arbiter.Core.Exceptions" "arbiter-core-0.1.0.0-inplace" 'True) (C1 ('MetaCons "JobNotFoundException" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) | |||||
newtype JobStolenException Source #
Heartbeat detected another worker reclaimed the job. The heartbeat retry combinator propagates this signal so the worker can stop duplicate work.
Constructors
| JobStolenException Text |
Instances
| Exception JobStolenException Source # | |||||
Defined in Arbiter.Core.Exceptions Methods toException :: JobStolenException -> SomeException # fromException :: SomeException -> Maybe JobStolenException # | |||||
| Generic JobStolenException Source # | |||||
Defined in Arbiter.Core.Exceptions Associated Types
Methods from :: JobStolenException -> Rep JobStolenException x # to :: Rep JobStolenException x -> JobStolenException # | |||||
| Show JobStolenException Source # | |||||
Defined in Arbiter.Core.Exceptions Methods showsPrec :: Int -> JobStolenException -> ShowS # show :: JobStolenException -> String # showList :: [JobStolenException] -> ShowS # | |||||
| Eq JobStolenException Source # | |||||
Defined in Arbiter.Core.Exceptions Methods (==) :: JobStolenException -> JobStolenException -> Bool # (/=) :: JobStolenException -> JobStolenException -> Bool # | |||||
| type Rep JobStolenException Source # | |||||
Defined in Arbiter.Core.Exceptions type Rep JobStolenException = D1 ('MetaData "JobStolenException" "Arbiter.Core.Exceptions" "arbiter-core-0.1.0.0-inplace" 'True) (C1 ('MetaCons "JobStolenException" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) | |||||
Helpers
throwRetryable :: MonadIO m => Text -> m a Source #
throwPermanent :: MonadIO m => Text -> m a Source #
throwTreeCancel :: MonadIO m => Text -> m a Source #
throwBranchCancel :: MonadIO m => Text -> m a Source #
throwParsing :: MonadIO m => Text -> m a Source #
throwInternal :: MonadIO m => Text -> m a Source #
throwJobNotFound :: MonadIO m => Text -> m a Source #
throwJobStolen :: MonadIO m => Text -> m a Source #