Anut-py / h-raylib

Haskell bindings for raylib
https://hackage.haskell.org/package/h-raylib
Apache License 2.0
84 stars 14 forks source link

The function loadDroppedFiles #52

Closed delyan-kirov closed 7 months ago

delyan-kirov commented 7 months ago

I don't know if this counts as a bug, but it does mean that the program will crash upon dropping a directory. The message is this:

WARNING: FILEIO: [/home/dk/1] File partially loaded (-2721076 bytes out of 0)
Segmentation fault (core dumped

I tried catching it like this:

 file <- case file' of
      Left e -> lift $ do
          putStr "ERROR: "
          print e
          return $ FilePathList 0 []
      Right f -> lift $ return f

It does not print the error, just crashes. I am confident this is the function that throws. I've never worked with try so I'm not sure that I'm doing it correctly.

Either way, it could be nice to have a variant that does not throw.