-1

I have developed a Google Workspace Add-on (published from a standalone Apps Script project) that relies on making an external API call for verification and event logging. The app works perfectly when tested locally and in my test environments using the Library link method.

The app was rejected by the Google Workspace Marketplace (GWM) Review Team due to a "Functionality" issue. The only error feedback provided is a generic "Add-on error: Something went wrong when executing the add-on."

I suspect the issue is related to the external network call failing within Google's testing environment (e.g., firewall/proxy restrictions or domain TLD blocking).

1. Core Functionality

The main logic involves calling a verification endpoint from the sidebar submission using UrlFetchApp.fetch().

2. Relevant Code Snippet (Error Handling)

I have implemented extensive error handling using try...catch and muteHttpExceptions: true. This function is where the GWM test likely fails:

// This is the function called from the sidebar
function processSidebarData(formData) {
  const verifyUrl = "[https://gateway.smit.team/webhook/google-sheet/verify-code](https://gateway.smit.team/webhook/google-sheet/verify-code)";
  
  try {
    const payload = { ...formData }; // Payload structure defined by me
    const options = {
      method: "post",
      payload: JSON.stringify(payload),
      contentType: "application/json",
      muteHttpExceptions: true // To catch non-200 responses
    };

    const response = UrlFetchApp.fetch(verifyUrl, options);
    const responseCode = response.getResponseCode();
    
    if (responseCode !== 200) {
      // Handles 4xx/5xx responses. Returns error message to the user.
      Logger.log(`Server Error: HTTP ${responseCode}`);
      return { success: false, message: "Verification API returned an error." };
    }
    
    const result = JSON.parse(response.getContentText());
    if (result.success) {
      // Success, proceeds to install trigger
      installOnEditTrigger();
      return { success: true, message: "Configuration successful." };
    } else {
      // Handles API business logic errors
      return { success: false, message: result.message || "Invalid code." };
    }

  } catch (e) {
    // THIS BLOCK SHOULD CATCH NETWORK/SSL/GENERAL FAILURES
    Logger.log('Network/API Execution Error: ' + e.message);
    // Returns a general failure message to the sidebar
    return { success: false, message: "A network or system error occurred. Please try again." };
  }
}
  1. Given the generic "Add-on error," is it highly likely that the failure is an unhandled exception outside of the try...catch block, or is it a specific network block that even a comprehensive try...catch cannot properly log?

  2. How can I remotely diagnose or get the specific Stack Trace or the exact exception message (e.g., related to SSL/firewall) that Google's testing environment encountered?

  3. Are there known issues with Google's testing proxies blocking outbound connections to external TLDs like .team?

1 Answer 1

1

From the question

I suspect the issue is related to the external network call failing within Google's testing environment (e.g., firewall/proxy restrictions or domain TLD blocking).

This assumption is wrong as Google Apps Script code runs on the server side, this means that the add-on is not affected by firewall, proxy restrictions or domain TLD blocking.

Looking at the code,

const verifyUrl = "[https://gateway.smit.team/webhook/google-sheet/verify-code](https://gateway.smit.team/webhook/google-sheet/verify-code)";
  

The value assigned to the verifyUrl variable is wrong. It should be a valid URL, but what is included looks like a link formatted using markdown.

Sign up to request clarification or add additional context in comments.

2 Comments

@HoàngHuy, I suggest you post a new question. Please ensure to include a minimal reproducible example. Please ensure to include the project manifest, the code for the relevant card and the call to fetch the data from the URL, and limit the post to only one question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.