How to debug a Google Drive API 500 Error on WordPress plugin?

Solution:

  1. Turn on debug mode. It may show the error on screen.
    define('WP_DEBUG', true);
    
  2. Repeat the error
  3. In wp-content there should be the debug.log with error