From da070bea4742025a1ea50c46f3cebc839ed55411 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 7 Oct 2019 00:04:47 -0700 Subject: Use typeMismatch. --- src/Text/Pandoc/App/Opt.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') 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 -- cgit v1.2.3