Add missing error checks
What does this MR do?
Files are being written to without checking the error message, which might lead to false positives or hard to debug tests.
Why was this MR needed?
Are there points in the code the reviewer needs to double check?
Does this MR meet the acceptance criteria?
- Added tests for this feature/bug
In case of conflicts with
master- branch was rebased