aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-10-07 00:04:47 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2019-10-07 00:04:47 -0700
commitda070bea4742025a1ea50c46f3cebc839ed55411 (patch)
tree5b709dd322d286a9d14be35997b5ac675f359052 /src
parent6e537aeda82e851c312291a79bce314b89052d06 (diff)
downloadpandoc-da070bea4742025a1ea50c46f3cebc839ed55411.tar.gz
Use typeMismatch.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/App/Opt.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/App/Opt.hs b/src/Text/Pandoc/App/Opt.hs
index 2c6c3c703..bc472d43c 100644
--- a/src/Text/Pandoc/App/Opt.hs
+++ b/src/Text/Pandoc/App/Opt.hs
@@ -35,6 +35,7 @@ import Text.Pandoc.Shared (camelCaseToHyphenated)
import qualified Data.Text as T
import Data.Aeson (defaultOptions, Options(..), FromJSON(..), ToJSON(..),
Value(..))
+import Data.Aeson.Types (typeMismatch)
#ifdef DERIVE_JSON_VIA_TH
import Data.Aeson.TH (deriveJSON)
#else
@@ -53,7 +54,7 @@ instance FromJSON LineEnding where
"crlf" -> return CRLF
"native" -> return Native
_ -> fail "Expecting LF, CRLF, or Native"
- parseJSON _ = fail "Expecting string"
+ parseJSON v = typeMismatch "String" v
-- | Data structure for command line options.
data Opt = Opt