Copyright | Copyright (C) 2006-2021 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
- | 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 Source #
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 | |
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
Show PandocError Source # | |
Defined in Text.Pandoc.Error Methods showsPrec :: Int -> PandocError -> ShowS show :: PandocError -> String showList :: [PandocError] -> ShowS | |
Generic PandocError Source # | |
Defined in Text.Pandoc.Error Associated Types type Rep PandocError :: Type -> Type | |
Exception PandocError Source # | |
Defined in Text.Pandoc.Error Methods toException :: PandocError -> SomeException fromException :: SomeException -> Maybe PandocError displayException :: PandocError -> String | |
Peekable PandocError | |
Defined in Text.Pandoc.Lua.Marshaling.PandocError Methods peek :: StackIndex -> Lua PandocError | |
Pushable PandocError | |
Defined in Text.Pandoc.Lua.Marshaling.PandocError Methods push :: PandocError -> Lua () | |
MonadError PandocError PandocPure | |
Defined in Text.Pandoc.Class.PandocPure Methods throwError :: PandocError -> PandocPure a catchError :: PandocPure a -> (PandocError -> PandocPure a) -> PandocPure a | |
MonadError PandocError PandocIO | |
Defined in Text.Pandoc.Class.PandocIO Methods throwError :: PandocError -> PandocIO a catchError :: PandocIO a -> (PandocError -> PandocIO a) -> PandocIO a | |
type Rep PandocError Source # | |
Defined in Text.Pandoc.Error type Rep PandocError = D1 ('MetaData "PandocError" "Text.Pandoc.Error" "pandoc-2.14.0.3-6zJRBxKXBfMLDbbgMg4noE" '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 "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 Source #
handleError :: Either PandocError a -> IO a Source #
Handle PandocError by exiting with an error message.