aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-06-20 22:44:09 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2017-06-20 22:44:09 +0200
commit6e6324badee219164bad271f3fcd037889962096 (patch)
tree3f655f686bf57829965bb1fd8dd1d9f274045291 /src
parentc349f0b0baef5866041b6668fff5bbb16f0002f9 (diff)
downloadpandoc-6e6324badee219164bad271f3fcd037889962096.tar.gz
Removed an 'error' bomb.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index 96885c9b1..793ee0996 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -55,6 +55,7 @@ import qualified Text.Pandoc.Builder as B
import Text.Pandoc.Class (PandocMonad(..), report)
import Text.Pandoc.Definition
import Text.Pandoc.Emoji (emojis)
+import Text.Pandoc.Error
import Text.Pandoc.Logging
import Text.Pandoc.Options
import Text.Pandoc.Parsing hiding (tableWith)
@@ -368,7 +369,9 @@ parseMarkdown = do
-- lookup to get sourcepos
case M.lookup n (stateNotes' st) of
Just (pos, _) -> report (NoteDefinedButNotUsed n pos)
- Nothing -> error "The impossible happened.") notesDefined
+ Nothing -> throwError $
+ PandocShouldNeverHappenError "note not found")
+ notesDefined
let doc = runF (do Pandoc _ bs <- B.doc <$> blocks
meta <- stateMeta' st
return $ Pandoc meta bs) st