חזרה לכל הפרומפטים
מערך טיפול בשגיאות בלתי מסיים (Error Boundary)
פרומפט ממוקד שאנו משתמשים בו לשכתוב של לוגיקת קצה (Frontend). מונע מבאג אקראי, כמו קריאת נתונים הפוכה, לרסק לאפליקציה את המסך הלבן של המוות.
מודל: Cursor / ChatGPT 4קטגוריה: פיתוח
You are an Application Stability Engineer. Your goal is to harden this React application against any Unhandled Promise Rejections or undefined object accesses (the dreaded "Cannot read properties of undefined"). REQUIREMENTS: 1. Wrap the entire Router and critical layout sections in React Error Boundaries. 2. Provide a fallback UI that communicates a professional 'Something went wrong, our team is flagged' message. 3. Instead of simple 'console.error', the Error Boundary MUST be wired to a logging function (e.g., standardizing error tracking via Base44 internal logs). 4. Sanitize API Responses: Ensure every fetch callback is wrapped in robust Zod/TypeScript validations before rendering properties to the screen. If parsing fails, trigger the Boundary rather than failing silently inside the DOM.
מתי כדאי להשתמש?
כשהאפליקציה קורסת מכל שגיאת API ואתם חייבים ייצוב הנדסי מהיר.