comment nit:

"The text was not written to the file successfully"