Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to contribute/ask about error messages? #11

Open
rubenrivera opened this issue Jul 8, 2018 · 0 comments
Open

How to contribute/ask about error messages? #11

rubenrivera opened this issue Jul 8, 2018 · 0 comments

Comments

@rubenrivera
Copy link

rubenrivera commented Jul 8, 2018

I found a conversation where Romain and Jean-Remi mentioned this repo while I was researching about an add-on error message, more explicitely about "You do not have permission to call showSidebar at functionName (fileName: lineNumber)". This error occurs on add-ons triggers created by user A from mydomain.com that are activated by actions made by user B from domain otherdomain.com when functionName tries to open a sidebar.

  1. Are this kind of errors something of interest for you?
  2. I didn't tried yet this library but if this error message isn't catched could I ask about it here?

Something like the following should help to reproduce the error message.

function onInstall(event) {
  onOpen(event);
}

function onOpen(event){
  SpreadsheetApp
  .getUi()
  .createAddonMenu()
  .addItem('Add trigger', 'addTrigger')
  .addItem('Remove all triggers', 'removeTriggers')
  .addToUi();
}

function addTrigger(){
  ScriptApp.newTrigger('respondeToSpreadsheetEdit')
  .forSpreadsheet(SpreadsheetApp.getActive())
  .onEdit()
  .create();
  SpreadsheetApp.getUi().alert('Trigger added.');
}

function respondeToSpreadsheetEdit(event){
  var html = '<p>Hello world!</p>';
  var title = 'Sidebar title';
  var userInterface = HtmlService.createHtmlOutput(html)
  .setTitle(title);
  SpreadsheetApp.getUi().showSidebar(userInterface);
}

function removeTriggers(){
  var triggers = ScriptApp.getProjectTriggers();
  triggers.forEach(function(trigger){
    ScriptApp.deleteTrigger(trigger);
  });
  SpreadsheetApp.getUi().alert('All triggers were removed.');

}

Steps to reproduce the error message

  1. Publish the above code as a Google Sheets add-on
  2. User A install the add-on, click on Add-ons > Add-on name > Add trigger
  3. User A shares the spreadsheet with user B
  4. User B edit cell A1
  5. Open the Stackdriver log for the add-on. There you will find something like the following:

You do not have permission to call showSidebar at respondToSpreadsheetEdit(Code:n)

where n is the code line number for SpreadsheetApp.getUi().showSidebar(userInterface);

P.S. Spanish version of the error message

No cuenta con el permiso para llamar a showSidebar at respondeToSpreadsheetEdit(Código:27)


Related issue on the Apps Script Issue Tracker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant