Skip to content

CvException from haskell callback cannot be catched. #57

@onixie

Description

@onixie

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions