问题
I'm working on generation of Google Presentation and sometimes batchUpdate throws the error:
{
"error": {
"code": 500,
"message": "Internal error encountered.",
"status": "INTERNAL"
}
}
Here's the example of the request body
回答1:
Issue:
Your request body is huge. You are requesting many updates in the presentation with a single call. Since you are getting a 500 error, the server is most likely having problems while processing this huge amount of requests.
It's certainly not a question of write request limits, since you are only making one single (large) write request (and HTTP status is not the appropriate one either).
Solution:
In any case, I would suggest you to split your call into as many parts as necessary so that you never get this error. Group the requests into different request bodies and call batchUpdate several successive times. This should fix your problem.
Reference:
- presentations.batchUpdate
- Slides API: Usage Limits
- 500 Internal Server Error
来源:https://stackoverflow.com/questions/60226544/the-method-presentations-batchupdate-throws-internal-error-encountered