CardService.newAuthorizationException()问题 [英] Problem with CardService.newAuthorizationException()

查看:53
本文介绍了CardService.newAuthorizationException()问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个具有相同代码的Gmail加载项(DEV和PROD版本).在我的代码中,我具有标准的accessProtectedResource函数(来自附件文档):

I have two Gmail Add-ons with the same code (DEV and PROD versions). And in my code I have standard accessProtectedResource function (from Add-ons documentation):

  function accessProtectedResource(url, data) {
  var service = getOAuthService();
  var maybeAuthorized = service.hasAccess();

  if (maybeAuthorized) {
    ...
  }

  if (!maybeAuthorized) {
    CardService.newAuthorizationException()
    .setAuthorizationUrl(service.getAuthorizationUrl())
    .setResourceDisplayName("Timelines")
    .throwException();
  }
}

问题在于,如果用户未获得授权-在PROD版本中,此函数将正确构建AuthorizationCard:

The problem is that if user not authorized - in PROD version this function build AuthorizationCard correctly:

但是在DEV中,使用相同的代码,相同的功能使加载项崩溃:

But in DEV, with the same code, the same function is crashing the add-on:

有什么想法吗?

推荐答案

这是一个错误!

这是一个以前在 Google问题跟踪器上报告的错误:

V8上的类AuthorizationException问题

您可以点击此页面左上方的问题编号旁边的☆,因为它可以让Google知道更多人正在遇到此问题,因此更有可能看到更快的结果.

You can hit the ☆ next to the issue number in the top left on this page as it lets Google know more people are encountering this and so it is more likely to be seen to faster.

这篇关于CardService.newAuthorizationException()问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆