add an error if we can't write the output file