بنقرة واحدة
error-handling-patterns
Standardized error responses to replace generic 500s with useful JSON
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Standardized error responses to replace generic 500s with useful JSON
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Dynamically manage MCP server limits by toggling disabled states in mcp_config.json. Use when hitting the 100-tool limit, or when needing a specific MCP server that is currently disabled.
When the user wants to set up, improve, or audit analytics tracking and measurement. Also use when the user mentions "set up tracking," "GA4," "Google Analytics," "conversion tracking," "event tracking," "UTM parameters," "tag manager," "GTM," "analytics implementation," "tracking plan," "how do I measure this," "track conversions," "attribution," "Mixpanel," "Segment," "are my events firing," or "analytics isn't working." Use this whenever someone asks how to know if something is working or wants to measure marketing results. For A/B test measurement, see ab-test-setup.
When the user wants to create or optimize an email sequence, drip campaign, automated email flow, or lifecycle email program. Also use when the user mentions "email sequence," "drip campaign," "nurture sequence," "onboarding emails," "welcome sequence," "re-engagement emails," "email automation," "lifecycle emails," "trigger-based emails," "email funnel," "email workflow," "what emails should I send," "welcome series," or "email cadence." Use this for any multi-email automated flow. For cold outreach emails, see cold-email. For in-app onboarding, see onboarding-cro.
When the user wants to plan, map, or restructure their website's page hierarchy, navigation, URL structure, or internal linking. Also use when the user mentions "sitemap," "site map," "visual sitemap," "site structure," "page hierarchy," "information architecture," "IA," "navigation design," "URL structure," "breadcrumbs," "internal linking strategy," "website planning," "what pages do I need," "how should I organize my site," or "site navigation." Use this whenever someone is planning what pages a website should have and how they connect. NOT for XML sitemaps (that's technical SEO — see seo-audit). For SEO audits, see seo-audit. For structured data, see schema-markup.
Wix Design System component reference. Use when building UI with @wix/design-system, choosing components, or checking props and examples. Triggers on "what component", "how do I make", "WDS", "show me props", or component names like Button, Card, Modal, Box, Text.
Creates HTTP endpoints for Wix CLI apps. Use only when the user specifically asks for a backend endpoint. Use when building REST API endpoints, backend HTTP handlers, or server-side logic. Triggers include backend API, HTTP endpoint, HTTP methods, form handling, file uploads.
| name | Error Handling Patterns |
| description | Standardized error responses to replace generic 500s with useful JSON |
| version | 1.0.0 |
Use this skill to implement structured error handling across the Wix-GAS Bridge.
Stop throwing raw text. Always return this JSON object from GAS doPost() catches:
return ContentService.createTextOutput(JSON.stringify({
success: false,
error: {
code: "ERROR_CODE_ENUM",
message: "Human readable message for logging",
userMessage: "Friendly message for UI",
retryable: true|false
}
})).setMimeType(ContentService.MimeType.JSON);
| Code | Meaning | User Message | Retry? |
|---|---|---|---|
AUTH_FAIL | API Key Invalid | "Access Denied. Contact Support." | No |
SCHEMA_MISMATCH | Missing fields | "Form Error. Please refresh." | No |
SIGNNOW_API_FAIL | SignNow is down | "Document Service Busy. Retrying..." | Yes |
LOCK_TIMEOUT | Simultaneous edits | "System Busy. Please submit again." | Yes |
DRIVE_QUOTA | Google Drive full | "Storage Error. Call Dispatch." | No |
When parsing the GAS response in gasIntegration.jsw:
// backend/gasIntegration.jsw
if (!result.success) {
console.error(`GAS Error [${result.error.code}]: ${result.error.message}`);
// Throw standard error for UI to catch
throw new Error(result.error.userMessage || "System Error");
}
In portal-indemnitor.js's catch block:
catch (error) {
// Show the user-friendly message from the backend
showError(error.message);
// If "System Busy", auto-retry logic could go here
}