VideoWriter: how can I detect an error?

Recently the drive where I tried to write the video was full. The python script terminated normally, leaving me with an unusable output file.

The write method does not return any value, so how can I detect an error like this?

Greetings, Martin

not with VideoWriter

https://pyav.org/docs/stable/