arbiter-core-0.1.0.0: Core types and logic for PostgreSQL-backed job queue
Safe HaskellNone
LanguageGHC2024

Arbiter.Core.Exceptions

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

Job Processing Exceptions

newtype JobRetryableException Source #

Transient failure — the job will be retried with backoff.

Instances

Instances details
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

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

newtype JobPermanentException Source #

Permanent failure — the job goes straight to the DLQ, no retries.

Instances

Instances details
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

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

newtype TreeCancelException Source #

Cancels an entire job tree from root to leaves. Use when a failure invalidates all work in the tree.

Instances

Instances details
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

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

newtype BranchCancelException Source #

Cancels the current branch (parent + all siblings). If the parent has a grandparent, the grandparent is resumed.

Instances

Instances details
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

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

newtype ParsingException Source #

Row decoding failure (internal).

Constructors

ParsingException Text 

Instances

Instances details
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

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

newtype InternalException Source #

Constructors

InternalException Text 

Instances

Instances details
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

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

newtype JobNotFoundException Source #

Job was deleted or reclaimed between claim and ack (internal).

Instances

Instances details
Exception JobNotFoundException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

Generic JobNotFoundException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

Associated Types

type Rep JobNotFoundException 
Instance details

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)))
Show JobNotFoundException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

Eq JobNotFoundException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

type Rep JobNotFoundException Source # 
Instance details

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

Instances details
Exception JobStolenException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

Generic JobStolenException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

Associated Types

type Rep JobStolenException 
Instance details

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)))
Show JobStolenException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

Eq JobStolenException Source # 
Instance details

Defined in Arbiter.Core.Exceptions

type Rep JobStolenException Source # 
Instance details

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 #

throwJobNotFound :: MonadUnliftIO m => Text -> m a Source #

throwJobStolen :: MonadUnliftIO m => Text -> m a Source #