安静的.hashCode()脚本死亡(GAS)

时间:2014-02-13 00:25:46

标签: google-apps-script

我有一个相对简单的脚本,有时候对某些用户(但到目前为止从未为所有者)生成以下执行脚本(删除脚本的开头):

[14-02-11 14:34:47:418 CET] Range.setValues([[[prg:some-string, 2014.02.11. 14:34:47]]]) [0 seconds]
[14-02-11 14:34:47:642 CET] SpreadsheetApp.flush() [0.224 seconds]
[14-02-11 14:34:47:642 CET] Browser.msgBox([String ....-ot.]) [0 seconds]
[14-02-11 14:34:47:647 CET] Browser.hashCode() [0 seconds]
[14-02-11 14:34:47:669 CET] CacheService.hashCode() [0 seconds]
[14-02-11 14:34:47:670 CET] CalendarApp.hashCode() [0 seconds]
[14-02-11 14:34:47:670 CET] Charts.hashCode() [0 seconds]
[14-02-11 14:34:47:672 CET] ContactsApp.hashCode() [0 seconds]
[14-02-11 14:34:47:672 CET] ContentService.hashCode() [0 seconds]
[14-02-11 14:34:47:673 CET] DocsList.hashCode() [0 seconds]
[14-02-11 14:34:47:673 CET] DocumentApp.hashCode() [0 seconds]
[14-02-11 14:34:47:675 CET] DriveApp.hashCode() [0 seconds]
[14-02-11 14:34:47:675 CET] FinanceApp.hashCode() [0 seconds]
[14-02-11 14:34:47:676 CET] FormApp.hashCode() [0 seconds]
[14-02-11 14:34:47:677 CET] GmailApp.hashCode() [0 seconds]
[14-02-11 14:34:47:678 CET] GroupsApp.hashCode() [0 seconds]
[14-02-11 14:34:47:679 CET] GroupsManager.hashCode() [0 seconds]
[14-02-11 14:34:47:679 CET] HtmlService.hashCode() [0 seconds]
[14-02-11 14:34:47:680 CET] Jdbc.hashCode() [0 seconds]
[14-02-11 14:34:47:681 CET] LanguageApp.hashCode() [0 seconds]
[14-02-11 14:34:47:681 CET] LockService.hashCode() [0 seconds]
[14-02-11 14:34:47:682 CET] Logger.hashCode() [0 seconds]
[14-02-11 14:34:47:685 CET] MailApp.hashCode() [0 seconds]
[14-02-11 14:34:47:685 CET] Maps.hashCode() [0 seconds]
[14-02-11 14:34:47:685 CET] NicknameManager.hashCode() [0 seconds]
[14-02-11 14:34:47:685 CET] ScriptApp.hashCode() [0 seconds]
[14-02-11 14:34:47:687 CET] ScriptDb.hashCode() [0 seconds]
[14-02-11 14:34:47:687 CET] ScriptProperties.hashCode() [0 seconds]
[14-02-11 14:34:47:687 CET] Session.hashCode() [0 seconds]
[14-02-11 14:34:47:688 CET] SitesApp.hashCode() [0 seconds]
[14-02-11 14:34:47:688 CET] SoapService.hashCode() [0 seconds]
[14-02-11 14:34:47:689 CET] SpreadsheetApp.hashCode() [0 seconds]
[14-02-11 14:34:47:689 CET] UiApp.hashCode() [0 seconds]
[14-02-11 14:34:47:691 CET] UrlFetchApp.hashCode() [0 seconds]
[14-02-11 14:34:47:691 CET] UserManager.hashCode() [0 seconds]
[14-02-11 14:34:47:691 CET] UserProperties.hashCode() [0 seconds]
[14-02-11 14:34:47:691 CET] Utilities.hashCode() [0 seconds]
[14-02-11 14:34:47:692 CET] Xml.hashCode() [0 seconds]
[14-02-11 14:34:47:692 CET] XmlService.hashCode() [0 seconds]
[14-02-11 14:34:47:696 CET] Spreadsheet.hashCode() [0 seconds]
[14-02-11 14:34:47:696 CET] Range.hashCode() [0 seconds]
[14-02-11 14:34:47:696 CET] Range.hashCode() [0 seconds]
[14-02-11 14:34:47:696 CET] User.hashCode() [0 seconds]
[14-02-11 14:34:47:696 CET] User.hashCode() [0 seconds]
[14-02-11 14:34:47:696 CET] Sheet.hashCode() [0 seconds]
[14-02-11 14:34:47:697 CET] Sheet.hashCode() [0 seconds]
[14-02-11 14:34:47:697 CET] Sheet.hashCode() [0 seconds]

请注意,成绩单未按惯例执行成功/执行失败消息结束。这是整个成绩单的最后一部分。

什么可能触发这个?

以下是该脚本的相关部分:

      var paymentRow2 = [ 
        "prg:"+event.user.getEmail(), 
        Utilities.formatDate(new Date(), "CET", "yyyy.MM.dd. HH:mm:ss")
      ];
      paymentSheet.getRange(paymentRowToWrite, 1, 1, paymentRow.length).setValues([paymentRow]);
      paymentSheet.getRange(paymentRowToWrite, 10, 1, paymentRow2.length).setValues([paymentRow2]);
      SpreadsheetApp.flush();
      Browser.msgBox("String" + dateAmount + "-ot.");
      //
      // Dies here -- seems to happen always after Browser.msgBox()
      //
      if (repeatingPayment) {
        if (inputRow[0] != "Hetente") {
          sheet.getRange(modifiedRowNum, 7, 1, 5).setValues([["","","","",""]]);
        }
        undoCommand(event);
      } else 
        if ((dateAmount == totalAmount) || (!GeneralUtil.isNumber(totalAmount))) {
          sheet.deleteRow(modifiedRowNum);
        } else { 
          sheet.getRange(modifiedRowNum, 5, 1, 7).setValues([[Math.round(totalAmount - dateAmount),inputRow[5],"","","","",""]]);
          undoCommand(event);
        }
      break;

有什么建议吗?

感谢。

1 个答案:

答案 0 :(得分:1)

这是否描述了您的问题?

https://code.google.com/p/google-apps-script-issues/issues/detail?id=2697

:使用onEdit触发器的dr脚本在为除了所有者之外的所有人调用Browser.msgBox之后静默失败。