| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Arbiter.Core.Exceptions
Contents
Description
Exceptions that job handlers throw to signal failure.
Using these types lets a handler control whether a failed job is retried or moved directly to the dead-letter queue.
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 :: MonadUnliftIO m => Text -> m a
- throwPermanent :: MonadUnliftIO m => Text -> m a
- throwTreeCancel :: MonadUnliftIO m => Text -> m a
- throwBranchCancel :: MonadUnliftIO m => Text -> m a
- throwParsing :: MonadIO m => Text -> m a
- throwInternal :: MonadIO m => Text -> m a
- throwJobNotFound :: MonadUnliftIO m => Text -> m a
- throwJobStolen :: MonadUnliftIO m => Text -> m a
Job Processing Exceptions
data JobException Source #
Caught by the worker to decide retry vs DLQ vs cancellation.
Constructors
| Retryable JobRetryableException | |
| Permanent JobPermanentException | |
| ParseFailure ParsingException | |
| TreeCancel TreeCancelException | Deletes the entire job tree from root to leaves. |
| BranchCancel BranchCancelException | Cascade-deletes the parent and all siblings. |
| JobNotFound JobNotFoundException | |
| JobStolen JobStolenException |
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))) | |||||
newtype ParsingException Source #
Row decoding failure (internal).
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 #
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 (internal).
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 (internal).
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 :: MonadUnliftIO m => Text -> m a Source #
throwPermanent :: MonadUnliftIO m => Text -> m a Source #
throwTreeCancel :: MonadUnliftIO m => Text -> m a Source #
throwBranchCancel :: MonadUnliftIO m => Text -> m a Source #
throwParsing :: MonadIO m => Text -> m a Source #
throwInternal :: MonadIO m => Text -> m a Source #
throwJobNotFound :: MonadUnliftIO m => Text -> m a Source #
throwJobStolen :: MonadUnliftIO m => Text -> m a Source #