From bafccd5aa2dc977e5e49b67c587e1507dd73417c Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 22 Feb 2021 13:59:38 -0800 Subject: [PATCH] T.P.Error: Add PandocUnsupportedCharsetError constructor... ...for PandocError. [API change] --- MANUAL.txt | 1 + src/Text/Pandoc/Error.hs | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/MANUAL.txt b/MANUAL.txt index 51898f224..ba031bcb2 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -1477,6 +1477,7 @@ Nonzero exit codes have the following meanings: 91 PandocMacroLoop 92 PandocUTF8DecodingError 93 PandocIpynbDecodingError + 94 PandocUnsupportedCharsetError 97 PandocCouldNotFindDataFileError 99 PandocResourceNotFound ----- ------------------------------------ diff --git a/src/Text/Pandoc/Error.hs b/src/Text/Pandoc/Error.hs index 0fdb7bfe5..8102f04cc 100644 --- a/src/Text/Pandoc/Error.hs +++ b/src/Text/Pandoc/Error.hs @@ -60,6 +60,7 @@ data PandocError = PandocIOError Text IOError | PandocMacroLoop Text | PandocUTF8DecodingError Text Int Word8 | PandocIpynbDecodingError Text + | PandocUnsupportedCharsetError Text | PandocUnknownReaderError Text | PandocUnknownWriterError Text | PandocUnsupportedExtensionError Text Text @@ -124,6 +125,8 @@ renderError e = "The input must be a UTF-8 encoded text." PandocIpynbDecodingError w -> "ipynb decoding error: " <> w + PandocUnsupportedCharsetError charset -> + "Unsupported charset " <> charset PandocUnknownReaderError r -> "Unknown input format " <> r <> case r of @@ -183,6 +186,7 @@ handleError (Left e) = PandocMacroLoop{} -> 91 PandocUTF8DecodingError{} -> 92 PandocIpynbDecodingError{} -> 93 + PandocUnsupportedCharsetError{} -> 94 PandocUnknownReaderError{} -> 21 PandocUnknownWriterError{} -> 22 PandocUnsupportedExtensionError{} -> 23