I have PHP code which inserts files into Google Drive. Most of the time it works fine. However I've noticed lately that it will randomly return a 502 error as follows:
<title>Error 502 (Server Error)!!1</title>
...
<p><b>502.</b> <ins>That’s an error.</ins>
<p>The server encountered a temporary error and could not complete your request.<p>Please try again in 30 seconds. <ins>That’s all we know.</ins>
I believe is a temporary error from Google.
It turns out that the file was actually created on Google Drive, so when I retry the request, I end up with a duplicate file.
As it's returned an error instead of a Files resource, how do I get the ID for the new file from Google?
Thanks