From c458184fabf13fa2ed6494ed2273db316620e312 Mon Sep 17 00:00:00 2001 From: ganesh-yallankar Date: Mon, 30 Mar 2026 18:28:05 -0700 Subject: [PATCH] add exception fallback --- skills/generating-apex/SKILL.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/skills/generating-apex/SKILL.md b/skills/generating-apex/SKILL.md index 8d00a95..b18ba56 100644 --- a/skills/generating-apex/SKILL.md +++ b/skills/generating-apex/SKILL.md @@ -142,6 +142,8 @@ Before finalizing, verify: CRUD/FLS enforced (SOQL + DML) ยท explicit sharing ke - Preserve exception cause chains: `new CustomException('message', cause)` (do not replace stack trace with concatenated messages) - Provide a custom exception class per service domain when meaningful - In `@AuraEnabled` methods, catch exceptions and rethrow as `AuraHandledException` +- Fallback option: when no meaningful domain exception exists, catch generic `Exception` and either rethrow it or wrap it in a minimal custom exception that preserves the original cause. + ### Null Safety