From 61456fd9ca6189a689ac0911f0e7260ce86e76d0 Mon Sep 17 00:00:00 2001 From: bringert Date: Sat, 24 Mar 2007 17:26:21 +0000 Subject: [PATCH] Better debugging output when SRG generation crashes because of a missing category. --- src/GF/Speech/SRG.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/GF/Speech/SRG.hs b/src/GF/Speech/SRG.hs index 995eb3b2e..8c3c5e02c 100644 --- a/src/GF/Speech/SRG.hs +++ b/src/GF/Speech/SRG.hs @@ -185,7 +185,9 @@ ungroupTokens = joinRE . mapRE (symbol (RESymbol . Cat) (REConcat . map (RESymbo -- lookupFM_ :: (Ord key, Show key) => Map key elt -> key -> elt -lookupFM_ fm k = Map.findWithDefault (error $ "Key not found: " ++ show k) k fm +lookupFM_ fm k = Map.findWithDefault err k fm + where err = error $ "Key not found: " ++ show k + ++ "\namong " ++ show (Map.keys fm) prtS :: Print a => a -> ShowS prtS = showString . prt \ No newline at end of file