【发布时间】:2014-08-01 02:43:38
【问题描述】:
以下代码使用 Google 的 nodejs 客户端版本 0.7 here 调用 Google Analytics Reporting API。它会在某些执行时返回 socket hang up 错误,但并非总是如此。这会是谷歌服务器端的错误吗?有没有简单的调试方法?顺便说一句,我连续打了几个电话,不确定是不是速率限制。
gapi = require "googleapis"
authClient = new gapi.auth.JWT(
config.ga.clientEmail,
config.ga.privateKeyPath,
null,
[config.ga.scopeUri]
)
authPromise = new Promise (resolve, reject) ->
authClient.authorize (err, token) ->
resolve token
return
return
authPromise.then ->
gapi.discover('analytics', 'v3')
.withAuthClient(authClient)
.execute (err, client) ->
...
【问题讨论】:
标签: node.js coffeescript google-api google-analytics-api google-api-nodejs-client