Description
Is your feature request related to a problem? Please describe.
Sometimes file writing fails. The only way to detect this is to check for the existence of the file.
In particular, I occasionally get the error:
[Plugin] 🟩 Capture failed, error: The operation could not be completed
[Plugin] 🟩 Underlying error: The operation couldn’t be completed. (OSStatus error -16356.)
[Plugin] 🔹 Finished writing
[Plugin] 🟩 Failed to remove temp files directory
While I'd love this issue to be fixed, I don't yet have a reproducible test case. I'd say around 5% of recordings fail in this manner. Until I can get you a better bug report on that, I'd at least like the API to tell me programmatically when this happens (rather than just logging it).
Describe the solution you'd like
In addition to FileWritingHandler. IsFileReady()
, it would be nice to have FileWritingHandler.DidFileWriteSucceed()
or GetErrors
or similar.
Describe alternatives you've considered
Use System.IO.File.Exists(), but this scares me because there could be a race condition (e.g. RenderHeads thinks the file has been written, but it hasn't flushed yet and a different thread checks .Exists(), which returns a false negative).
Additional context
Again, the underlying issue is the frequency at which file writes fail - and I'm working on finding a reproducible test case for that.