CV
CV copied to clipboard
CvException from haskell callback cannot be catched.
suppose we have a piece of code like below,
test = do
setCatch
image <- readFromFile "smallLena.jpg" :: IO (Image GrayScale D32)
saveImage "poks.ok" image `catch`
(\e -> do let err = show (e :: CvException)
print "catched"
return ())
print "safe landed"
return ()
saveImage
throws an CvException
because of bad file extension,
but neither "catched" nor "safe landed" are printed out.
I think the problem originates from setCatch :: IO()
which will call a throw in haskell callback when opencv errors happen.
GLFW-b also had a similar problem before.