تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
يمكنك تصحيح أخطاء موصل المنتدى بطريقتين:
تفعيل رسائل الخطأ الموسعة
تسجيل بيانات التنفيذ ذات الصلة
يوضّح هذا الدليل كيفية الاستفادة بشكل فعّال من هذه الإمكانات.
تفعيل/إيقاف ميزات تصحيح الأخطاء
من المفترَض أن يعرض isAdminUser() الخطأ true إذا ظهرت للمستخدم الحالي رسائل تصحيح الأخطاء وعمليات تتبُّع تسلسل استدعاء الدوال البرمجية. إذا عرضت السمة isAdminUser() "خطأ" أو لم يتم تحديدها
وحدث خطأ، ستظهر للمستخدم رسالة خطأ عامة.
نصائح تصحيح الأخطاء
صمِّم isAdminUser() بحيث تعرض دائمًا القيمة true للمطوِّرين.
يمكنك استخدام getEffectiveUser() مع قائمة عناوين البريد الإلكتروني الآمنة للمستخدمين
الموثوقين لإضافة المستخدمين الذين تظهر لهم التفاصيل الكاملة للأخطاء أو إزالتهم منها بسهولة.
ويمكن أن يكون ذلك مفيدًا بشكل خاص إذا واجه المستخدم خطأً إنك فيه
مشكلة في إعادة إنتاجه.
يمكنك استخدام newDebugError() بشكل متحرر للثوابت التي من المفترض
أن تكون صحيحة. يمكن أن يساعد ذلك في تضييق نطاق المشاكل في المستقبل.
تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\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."]]