קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
אפשר לנפות באגים ב'מחבר הקהילה' בשתי דרכים:
הפעלת הודעות שגיאה מורחבות
רישום של נתוני ביצוע רלוונטיים
במדריך הזה מוסבר איך להשתמש ביכולות האלה בצורה יעילה.
הפעלה/השבתה של תכונות לניפוי באגים
אם למשתמש הנוכחי יוצגו הודעות על תוצאות ניפוי באגים ודוחות קריסות, הפונקציה isAdminUser() אמורה להחזיר true. אם המדיניות isAdminUser() מחזירה את הערך False או לא מוגדר,
ותוצג שגיאה, המשתמש יראה הודעת שגיאה גנרית.
טיפים לניפוי באגים
עיצוב isAdminUser() כך שתמיד יחזיר true למפתחים.
כדי להוסיף או להסיר בקלות משתמשים שאמורים לראות את פרטי השגיאה המלאים, כדאי להשתמש ב-getEffectiveUser() בשילוב עם רשימת פריטים בטוחה באימייל של משתמשים מהימנים.
זה יכול להיות שימושי במיוחד אם משתמשים נתקלים בשגיאה שקשה לכם לשחזר.
השתמשו בשפה הליברלית ב-newDebugError() למשתנים שאמורים להחזיק בערך true. כך תוכלו לצמצם בעיות בעתיד.
[null,null,["עדכון אחרון: 2025-07-25 (שעון UTC)."],[[["\u003cp\u003eCommunity Connectors can be debugged by enabling extended error messages or logging execution data.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eisAdminUser()\u003c/code\u003e function controls debug message visibility, returning \u003ccode\u003etrue\u003c/code\u003e for users who should see them and \u003ccode\u003efalse\u003c/code\u003e otherwise.\u003c/p\u003e\n"],["\u003cp\u003eLeverage Apps Script's logging mechanisms, such as the built-in Logger, Stackdriver, or even a Google Sheet, to proactively identify and resolve bugs while protecting user data privacy.\u003c/p\u003e\n"],["\u003cp\u003eDesigning \u003ccode\u003eisAdminUser()\u003c/code\u003e to always return \u003ccode\u003etrue\u003c/code\u003e for developers and using \u003ccode\u003egetEffectiveUser()\u003c/code\u003e with a safelist can aid in debugging and reproducing user errors.\u003c/p\u003e\n"]]],[],null,["You can debug your Community Connector in two ways:\n\n1. Enabling extended error messages\n2. Logging relevant execution data\n\nThis guide outlines how to make effective use of these capabilities.\n\nEnabling/disabling debug features\n\n`isAdminUser()` should return `true` if the current user should see debug\nmessages and stack traces. If `isAdminUser()` returns false, or is not defined,\nand an error occurs, the user will see a generic error message.\n| **Note:** Use `newUserError()` if users should see the error message regardless of the `isAdminUser()` response.\n\nDebugging Tips\n\n- Design `isAdminUser()` so it always returns `true` for developers.\n- Use [`getEffectiveUser()`](/apps-script/reference/base/session#getEffectiveUser()) in combination with an email safelist of trusted users to easily add or remove users that should see the full error details. This can be especially useful if a user runs into an error that you have trouble reproducing.\n- Make liberal use of [`newDebugError()`](/apps-script/reference/data-studio/community-connector#newDebugError()) for invariants that should hold true. This can help with narrowing down problems in the future.\n\nApps Script logging\n\nApps Script provides [different mechanisms for logging](/apps-script/guides/logging) including the built-in\n[Apps Script Logger](https://developers.google.com/apps-script/reference/base/logger), [Stackdriver Logging](https://developers.google.com/apps-script/guides/logging#stackdriver_logging), and [Stackdriver Error Reporting](https://developers.google.com/apps-script/guides/logging#stackdriver_error_reporting).\nYou can also try [logging to a Google Sheet](https://developers.google.com/apps-script/reference/spreadsheet/spreadsheet-app). Proactive logging can help to\nquickly narrow in on the cause of bugs, though care should be taken to not log\nsensitive user data."]]