In case of exception, report the offending function

This commit is contained in:
krangelov
2021-09-17 11:22:18 +02:00
parent 3f31d86d0d
commit ddb01b41be
3 changed files with 29 additions and 26 deletions

View File

@@ -75,7 +75,7 @@ branchPGF_ :: Ptr PgfText -> PGF -> Transaction a -> IO PGF
branchPGF_ c_name p (Transaction f) =
withForeignPtr (a_db p) $ \c_db ->
withForeignPtr (revision p) $ \c_revision ->
withPgfExn $ \c_exn ->
withPgfExn "branchPGF" $ \c_exn ->
mask $ \restore -> do
c_revision <- pgf_clone_revision c_db c_revision c_name c_exn
ex_type <- (#peek PgfExn, type) c_exn
@@ -103,7 +103,7 @@ checkoutPGF :: PGF -> String -> IO (Maybe PGF)
checkoutPGF p name =
withForeignPtr (a_db p) $ \c_db ->
withText name $ \c_name -> do
c_revision <- withPgfExn (pgf_checkout_revision c_db c_name)
c_revision <- withPgfExn "checkoutPGF" (pgf_checkout_revision c_db c_name)
if c_revision == nullPtr
then return Nothing
else do fptr2 <- C.newForeignPtr c_revision (withForeignPtr (a_db p) (\c_db -> pgf_free_revision c_db c_revision))