Skip to content

Commit

Permalink
Better error message from TH converter
Browse files Browse the repository at this point in the history
  • Loading branch information
maksbotan committed Sep 28, 2023
1 parent c12b491 commit 9d5e9d7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Database/Bolt/Extras/Template/Internal/Converters.hs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,10 @@ getProp container (fieldName, fieldMaybe) | fieldMaybe && fieldName `notMember`
where
exactE v = case exactEither v of
Right res -> res
Left err -> error $ show err
Left err -> error
$ "Could not unpack "
<> unpack fieldName <> ": " <> show err
<> ", value: " <> show v

unpackError :: HasCallStack => Show c => c -> String -> a
unpackError container label = error $ $currentLoc ++ " could not unpack " ++ label ++ " from " ++ show container
Expand Down

0 comments on commit 9d5e9d7

Please sign in to comment.