Hello, I have a very annoying problem. I have my game save all these variables to a certain file path that I believe should work on all computers but, in case it doesn’t work I would like my game to notice that it fails to save and show up a GUI box saying my custom fail message to the player. So I tried this:
// Close the file (^ above is where I write the var's into the file)
saveStream.Close();
try
{
throw saveStream.Close ();
}
catch (err)
{
MoveAround.saveFailed = true;
return;
}
// Give confirmation that the file has been saved
print ( "Data Saved at: " + filePath2 + "/" + fileName2 );
MoveAround.saveWork = true;
in the save script’s save function, and I get these errors:
'void' is not a valid argument type for throw, only strings and exceptions are allowed.
so um…HOW DO I FIX THIS (I’ve seen a c# example but not a javascript example of a try+catch)!!! Your help will be greatly appreciated!
I don't know how to...I never did a try catch before...not at all
– RydrakoI've seen a c# example but not a javascript example.
– Rydrako