I recently released a game on Steam with openFL and HaxeFlixel and some users are reporting a crash on startup with the error “Error: Custom([file_write,stderr])”
I’ve seen the error myself in the past during development but it was very sporadic and haven’t seen it for a few months at least, and can’t reproduce it. It happens on the windows target. Maybe mac too but haven’t heard any reports yet.
I’ve seen similar errors myself, and I’ve been able to work them out based on context. Normally the error looks more like [file_open, C:\Example\Path\To\SomeFile.txt]. At first I thought it was a “this file is open in another program” error, but it’s more general than that. file_open is the name of the function that crashed, and SomeFile.txt was the file that it was trying to open.
So in your case, it’s the file_write function that’s crashing, and it’s crashing when it tries to write to stderr.
I don’t know what you could do about it, but hopefully this helps anyway.
Makes sense, and is also what I found in an old issue here:
FWIW the Custom([file_write,stderr]) is a message that appears when an exception is thrown and not caught. OpenFL then somehow tries to write that error to disk or something, but fails in the process and that dialog box appears. So, that means that any error that would throw an exception will give that same dialog box.
But unfortunately that still doesn’t help much, it still amounts to basically just “there was an error.”
This error occurs when trying to write a file, but it can’t – like trying to write to a file when the directory path has not been created. Could this be caused by using a SharedObject, or do you write a file somewhere in your code?
The only file writing being done would be with a SharedObject but I’m not sure if that would be the reason. Some users have fixed it after updating some sound drivers it seems, and others have it happen sporadically with different results depending on what other programs they have running. Nobody’s seem to found something that fixes it or makes it fail 100% of the time it seems.