We have an Apps Script app is triggered by the "on Form submit" event of a Google Form. We take the information that was collected in the form, and after making a copy of a predefined Google Document template, we write the form data to the newly created Google document. For the most part - this works, however there are days (like today) when numerous
"We're sorry, a server error occurred. Please wait a bit and try again."
errors are thrown. The line of code that it's thrown at is:
var copy = template.makeCopy(title);
Utilities.sleep(4000);
return copy;
I believe I have followed the best practice but using the Utilities.sleep()
function, but it doesn't seem to help. Today alone I have seen this error come up at least 15 times! The frustrating part is that this is not consistent. As mentioned previously, the app can run for days with no error, then on other days I get a bunch of these errors.
I have seen an issue logged in Feb 2014 that I starred, but there doesn't seem to be any resolution to it.
Please can anybody point me in the right direction as to what I can do to stop seeing that error?