var::writeToStream should return a bool

juce::OutputStream::write and corresponding writeInt etc. all return a bool indicating whether the write operation was successful.

I use this consistently to be able to handle any I/O errors when persisting my plugin’s state, i.e. display a warning message.

juce::var::writeToStream returns void, while it would make sense to return a bool indicating success here as well.

1 Like