Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CvException from haskell callback cannot be catched. #57

Open
onixie opened this issue Oct 20, 2016 · 0 comments
Open

CvException from haskell callback cannot be catched. #57

onixie opened this issue Oct 20, 2016 · 0 comments

Comments

@onixie
Copy link

onixie commented Oct 20, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant