mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-26 18:26:36 +00:00
Error: Added PandocOptionError.
This commit is contained in:
@@ -97,7 +97,7 @@ parseOptions options' defaults = do
|
||||
let unknownOptionErrors = foldr handleUnrecognizedOption [] unrecognizedOpts
|
||||
|
||||
unless (null errors && null unknownOptionErrors) $
|
||||
E.throwIO $ PandocAppError 2 $
|
||||
E.throwIO $ PandocOptionError $
|
||||
concat errors ++ unlines unknownOptionErrors ++
|
||||
("Try " ++ prg ++ " --help for more information.")
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ data PandocError = PandocIOError String IOError
|
||||
| PandocParseError String
|
||||
| PandocParsecError Input ParseError
|
||||
| PandocMakePDFError String
|
||||
| PandocOptionError String
|
||||
| PandocAppError Int String
|
||||
deriving (Show, Typeable, Generic)
|
||||
|
||||
@@ -77,6 +78,7 @@ handleError (Left e) =
|
||||
else ""
|
||||
in err 65 $ "\nError at " ++ show err' ++ errorInFile
|
||||
PandocMakePDFError s -> err 65 s
|
||||
PandocOptionError s -> err 2 s
|
||||
PandocAppError ec s -> err ec s
|
||||
|
||||
err :: Int -> String -> IO a
|
||||
|
||||
Reference in New Issue
Block a user