Skip to content

Commit 14ded25

Browse files
committed
Report what references are unbound.
1 parent 4fd069a commit 14ded25

File tree

1 file changed

+2
-2
lines changed
  • src/Codec/CBOR/Cuddle/CBOR

1 file changed

+2
-2
lines changed

src/Codec/CBOR/Cuddle/CBOR/Gen.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ resolveIfRef (MRuleRef n) = do
367367
-- Since we follow a reference, we increase the 'depth' of the gen monad.
368368
modify @"depth" (+ 1)
369369
case Map.lookup n cddl of
370-
Nothing -> error "Unbound reference"
370+
Nothing -> error $ "Unbound reference: " <> show n
371371
Just val -> resolveIfRef $ runIdentity val
372372

373373
-- | Generate a CBOR Term corresponding to a top-level name.
@@ -382,7 +382,7 @@ genForName :: (RandomGen g) => Name -> M g Term
382382
genForName n = do
383383
(CTreeRoot cddl) <- ask @"cddl"
384384
case Map.lookup n cddl of
385-
Nothing -> error "Unbound reference"
385+
Nothing -> error $ "Unbound reference: " <> show n
386386
Just val ->
387387
genForNode (runIdentity val) >>= \case
388388
S x -> pure x

0 commit comments

Comments
 (0)