pdf-toolbox-core-0.0.1.1: A collection of tools for processing PDF files.

Safe HaskellNone

Pdf.Toolbox.Core.Error

Description

Error used by API

Synopsis

Documentation

data PdfError Source

Errors

Constructors

ParseError [String] String

Parser error

IOError IOError 
AnnotatedError String PdfError 
UnexpectedError String

Something unexpected

Instances

type PdfE m = EitherT PdfError mSource

API uses this for error handling

annotateError :: Monad m => String -> PdfE m a -> PdfE m aSource

Wrap any PdfError into AnnotatedError

Usefull when you want to add high-level description to error, returned by low-level function

annotatingError :: Monad m => PdfE m a -> String -> PdfE m aSource

annotateError with fliped arguments

tryPdfIO :: MonadIO m => IO a -> PdfE m aSource

Catch exception if any and convert to IOError