WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
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