google-sheetsgoogle-sheets-apiserver-error

Getting "We're sorry, a server error occurred. Please wait a bit and try again."


I see the error after the code has finished. I have try and catch for basically every function in the code and error messaging for each error that pops but none trigger.

I put a debugging line that prints to the console "success" as the last line in code but it runs and afterwards returns:

We're sorry, a server error occurred. Please wait a bit and try again.


Solution

  • I solved the problem eventually.There was no code that seemed to cause the error cuz it had no errors until if completely finished running. Eventually I found the problem, for some reason I couldn't use two functions of "getRange()" in the same line so I splitt it and now it works. It was a bit more complicated than that cuz it had some for loops but the general I idea was splitting the command into two lines.