pandoc-2.17.1.1: Conversion between markup formats

Copyright | Copyright (C) 2006-2022 John MacFarlane
License | GNU GPL, version 2 or above
Maintainer | John MacFarlane <jgm@berkeley.edu>
Stability | alpha
Portability | portable
Safe Haskell | None
Language | Haskell2010

Text.Pandoc.Error

Description

This module provides a standard way to deal with possible errors encountered during parsing.

Synopsis

- data PandocError
  - = PandocIOError Text IOError
  - | PandocHttpError Text HttpException
  - | PandocShouldNeverHappenError Text
  - | PandocSomeError Text
  - | PandocParseError Text
  - | PandocParsecError Sources ParseError
  - | PandocMakePDFError Text
  - | PandocOptionError Text
  - | PandocSyntaxMapError Text
  - | PandocFailOnWarningError
  - | PandocPDFProgramNotFoundError Text
  - | PandocPDFError Text
  - | PandocXMLError Text Text
  - | PandocFilterError Text Text
  - | PandocLuaError Text
  - | PandocCouldNotFindDataFileError Text
  - | PandocCouldNotFindMetadataFileError Text
  - | PandocResourceNotFound Text
  - | PandocTemplateError Text
  - | PandocAppError Text
  - | PandocEpubSubdirectoryError Text
  - | PandocMacroLoop Text
  - | PandocUTF8DecodingError Text Int Word8
  - | PandocIpynbDecodingError Text
  - | PandocUnsupportedCharsetError Text
  - | PandocUnknownReaderError Text
  - | PandocUnknownWriterError Text
  - | PandocUnsupportedExtensionError Text Text
  - | PandocCiteprocError CiteprocError
  - | PandocBibliographyError Text Text
- renderError :: PandocError -> Text
- handleError :: Either PandocError a -> IO a

# Documentation

data PandocError #

Constructors

PandocIOError Text IOError |
PandocHttpError Text HttpException |
PandocShouldNeverHappenError Text |
PandocSomeError Text |
PandocParseError Text |
PandocParsecError Sources ParseError |
PandocMakePDFError Text |
PandocOptionError Text |
PandocSyntaxMapError Text |
PandocFailOnWarningError |
PandocPDFProgramNotFoundError Text |
PandocPDFError Text |
PandocXMLError Text Text |
PandocFilterError Text Text |
PandocLuaError Text |
PandocCouldNotFindDataFileError Text |
PandocCouldNotFindMetadataFileError Text |
PandocResourceNotFound Text |
PandocTemplateError Text |
PandocAppError Text |
PandocEpubSubdirectoryError Text |
PandocMacroLoop Text |
PandocUTF8DecodingError Text Int Word8 |
PandocIpynbDecodingError Text |
PandocUnsupportedCharsetError Text |
PandocUnknownReaderError Text |
PandocUnknownWriterError Text |
PandocUnsupportedExtensionError Text Text |
PandocCiteprocError CiteprocError |
PandocBibliographyError Text Text |

#### Instances

Instances details

Show PandocError # |
Instance details Defined in Text.Pandoc.Error Methods showsPrec :: Int -> PandocError -> ShowS # show :: PandocError -> String # showList :: [PandocError] -> ShowS #
Generic PandocError # |
Instance details Defined in Text.Pandoc.Error Associated Types type Rep PandocError :: Type -> Type # Methods from :: PandocError -> Rep PandocError x # to :: Rep PandocError x -> PandocError #
Exception PandocError # |
Instance details Defined in Text.Pandoc.Error Methods toException :: PandocError -> SomeException # fromException :: SomeException -> Maybe PandocError # displayException :: PandocError -> String #
LuaError PandocError # |
Instance details Defined in Text.Pandoc.Lua.ErrorConversion Methods popException :: LuaE PandocError PandocError # pushException :: PandocError -> LuaE PandocError () # luaException :: String -> PandocError #
MonadError PandocError PandocPure # |
Instance details Defined in Text.Pandoc.Class.PandocPure Methods throwError :: PandocError -> PandocPure a # catchError :: PandocPure a -> (PandocError -> PandocPure a) -> PandocPure a #
MonadError PandocError PandocIO # |
Instance details Defined in Text.Pandoc.Class.PandocIO Methods throwError :: PandocError -> PandocIO a # catchError :: PandocIO a -> (PandocError -> PandocIO a) -> PandocIO a #
type Rep PandocError # |
Instance details Defined in Text.Pandoc.Error type Rep PandocError = D1 ('MetaData "PandocError" "Text.Pandoc.Error" "pandoc-2.17.1.1-DKf6lIxlr03v7sFr349kZ" 'False) ((((C1 ('MetaCons "PandocIOError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IOError)) :+: (C1 ('MetaCons "PandocHttpError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 HttpException)) :+: C1 ('MetaCons "PandocShouldNeverHappenError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))) :+: ((C1 ('MetaCons "PandocSomeError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "PandocParseError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) :+: (C1 ('MetaCons "PandocParsecError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Sources) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ParseError)) :+: C1 ('MetaCons "PandocMakePDFError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))))) :+: (((C1 ('MetaCons "PandocOptionError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "PandocSyntaxMapError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) :+: (C1 ('MetaCons "PandocFailOnWarningError" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PandocPDFProgramNotFoundError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))) :+: ((C1 ('MetaCons "PandocPDFError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "PandocXMLError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) :+: (C1 ('MetaCons "PandocFilterError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "PandocLuaError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))))) :+: (((C1 ('MetaCons "PandocCouldNotFindDataFileError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: (C1 ('MetaCons "PandocCouldNotFindMetadataFileError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "PandocResourceNotFound" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))) :+: ((C1 ('MetaCons "PandocTemplateError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "PandocAppError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) :+: (C1 ('MetaCons "PandocEpubSubdirectoryError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "PandocMacroLoop" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))))) :+: (((C1 ('MetaCons "PandocUTF8DecodingError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word8))) :+: C1 ('MetaCons "PandocIpynbDecodingError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) :+: (C1 ('MetaCons "PandocUnsupportedCharsetError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "PandocUnknownReaderError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))) :+: ((C1 ('MetaCons "PandocUnknownWriterError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "PandocUnsupportedExtensionError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) :+: (C1 ('MetaCons "PandocCiteprocError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CiteprocError)) :+: C1 ('MetaCons "PandocBibliographyError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))))))

renderError :: PandocError -> Text #

handleError :: Either PandocError a -> IO a #

Handle PandocError by exiting with an error message.