git.iko.soy/typeable/pandoc
on master help sign in
Use typeMismatch.
commitda070bea4742025a1ea50c46f3cebc839ed55411 authorJohn MacFarlane <jgm@berkeley.edu> dateMon 7 Oct 2019, 00:04 (7 years ago) parent6e537ae
1 file changed+2−1
src/Text/Pandoc/App/Opt.hs+2−1
src/Text/Pandoc/App/Opt.hs+2−1
@@ -35,6 +35,7 @@ import Text.Pandoc.Shared (camelCaseToHyphenated)
3535import qualified Data.Text as T
3636import Data.Aeson (defaultOptions, Options(..), FromJSON(..), ToJSON(..),
3737 Value(..))
38+import Data.Aeson.Types (typeMismatch)
3839#ifdef DERIVE_JSON_VIA_TH
3940import Data.Aeson.TH (deriveJSON)
4041#else
@@ -53,7 +54,7 @@ instance FromJSON LineEnding where
5354 "crlf" -> return CRLF
5455 "native" -> return Native
5556 _ -> fail "Expecting LF, CRLF, or Native"
56− parseJSON _ = fail "Expecting string"
57+ parseJSON v = typeMismatch "String" v
5758
5859-- | Data structure for command line options.
5960data Opt = Opt