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

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

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.

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

Engine-internal signals

newtype ParsingException Source #

Row decoding failure (engine-internal). Classified as a permanent failure by the worker.

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 #

Generic engine-internal failure (e.g. missing connection, bad params).

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. The worker recognizes this signal via isJobGoneException and skips retry/DLQ.

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. The heartbeat retry combinator propagates this signal so the worker can stop duplicate work.

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