@@ -493,21 +493,17 @@ externalFilter f args' d = liftIO $ do
493493 unless (exists && isExecutable) $ do
494494 mbExe <- findExecutable f'
495495 when (isNothing mbExe) $
496− E.throwIO $ PandocAppError 83 $
497− "Error running filter " ++ f ++ ":\n" ++
498− "Could not find executable '" ++ f' ++ "'."
496+ E.throwIO $ PandocFilterError f ("Could not find executable " ++ f')
499497 env <- getEnvironment
500498 let env' = Just $ ("PANDOC_VERSION", pandocVersion) : env
501499 (exitcode, outbs) <- E.handle filterException $
502500 pipeProcess env' f' args'' $ encode d
503501 case exitcode of
504502 ExitSuccess -> return $ either error id $ eitherDecode' outbs
505− ExitFailure ec -> E.throwIO $ PandocAppError 83 $
506− "Error running filter " ++ f ++ "\n" ++
507− "Filter returned error status " ++ show ec
503+ ExitFailure ec -> E.throwIO $ PandocFilterError f
504+ ("Filter returned error status " ++ show ec)
508505 where filterException :: E.SomeException -> IO a
509− filterException e = E.throwIO $ PandocAppError 83 $
510− "Error running filter " ++ f ++ "\n" ++ show e
506+ filterException e = E.throwIO $ PandocFilterError f (show e)
511507
512508-- | Data structure for command line options.
513509data Opt = Opt