Getting 500: prerequisite failed with folder patches. What for?

With interruptions, I see this error from Drive when I run Patch (the Java client library) in the folder to update my status. Retrying does not resolve the issue.

I suppose that...

  • It really should be 412 (not 500).
  • The patch performs etag comparison, whereas by changing the code to Update, it will not

fwiw I changed my code to use Update, but since the problem is intermittent, I cannot be sure that my resolution is valid. It would be great if someone who had access to any documentation could confirm (or point me in the right direction).

The code...

driveService.files().patch(enFolder.getId(),enFolder).execute(); 
+1
source share
1 answer

You can safely use the update if you have the latest state of the file, the Drive API should not respond even with 412 in your case, because you do not set the If-Match header.

0
source

Source: https://habr.com/ru/post/1498380/


All Articles