我使用的是谷歌云api。
以下错误使我的页面变为空白。调试日志文件在加载每个空白页时显示以下错误。
Fatal error: Uncaught exception 'Google_Service_Exception' with message '{
"error": {
"errors": [
{
"domain": "global",
"reason": "backendError",
"message": "Backend Error"
}
],
"code": 500,
"message": "Backend Error"
}
}
' in /var/www/html/wp-content/plugins/test/google_api/src/Google/Http/REST.php:123
Stack trace:
#0 /var/www/html/wp-content/plugins/test/google_api/src/Google/Http/REST.php(82): Google_Http_REST::decodeHttpResponse(Object(GuzzleHttpPsr7Response), Object(Guzz
leHttpPsr7Request), 'Google_Service_...')
#1 [internal function]: Google_Http_REST::doExecute(Object(GuzzleHttpClient), Object(GuzzleHttpPsr7Request), 'Google_Service_...')
#2 /var/www/html/wp-content/plugins/test/google_api/src/Google/Task/Runner.php(181): call_user_func_array(Array, Array)
#3 /var/www/html/wp-content/plugins/test/google_api/src/Google/Http/REST.php(57): Google_Task_Runner->run()
#4 /var/www/html/wp-content/plugins/test/google_api/src/Google/Client.p in /var/www/html/wp-content/plugins/test/google_api/src/Google/Http/REST.php on li
ne 123
Fatal error: Uncaught exception 'Google_Service_Exception' with message 'Not Found' in /var/www/html/wp-content/plugins/test/google_api/src/Google/Http/REST.php:123
Stack trace:
#0 /var/www/html/wp-content/plugins/test/google_api/src/Google/Http/REST.php(82): Google_Http_REST::decodeHttpResponse(Object(GuzzleHttpPsr7Response), Object(Guzz
leHttpPsr7Request), 'Google_Service_...')
#1 [internal function]: Google_Http_REST::doExecute(Object(GuzzleHttpClient), Object(GuzzleHttpPsr7Request), 'Google_Service_...')
#2 /var/www/html/wp-content/plugins/test/google_api/src/Google/Task/Runner.php(181): call_user_func_array(Array, Array)
#3 /var/www/html/wp-content/plugins/test/google_api/src/Google/Http/REST.php(57): Google_Task_Runner->run()
#4 /var/www/html/wp-content/plugins/test/google_api/src/Google/Client.php(758): Google_Http_REST::execute(Object(GuzzleHttpClient), Object(GuzzleHttpPsr7Request)
, 'Google_Service_...', Array)
#5 /var/www/html/wp-content/plugins/test in /var/www/html/wp-content/plugins/test/google_api/src/Google/Http/REST.php on line 123
我认为这两个错误都有关联。提前谢谢。
我假设您使用的是用于PHP的GoogleAPI客户端库。如果是这样,您可以直接向该库的工程师报告此问题。
我确实看到类似的报告,其中的解决方案是用户端代码修复"Google_Service_Exception">表示您提出的请求未通过身份验证、帖子正文无效/格式错误和/或指向无效URL。
因此,我建议您尝试进一步调试代码,以便查看代码的哪一行引发了此错误。请确保您正确使用了库,并且您的API请求是正确的。还要确保您使用的是库的最新版本。