When you create a managed package for AppExchange, you can specify a user to receive an email notification when an exception occurs that Apex doesn’t catch.
Required Editions
| Available in: Salesforce Classic (not available in all orgs) |
| Available in: Performance, Unlimited, Developer, and Enterprise Editions |
| User Permissions Needed | |
|---|---|
| To create packages: | Create AppExchange Packages |
| To upload packages: | Upload AppExchange Packages |
| To create Apex: | Author Apex |
Uncaught exceptions can be thrown from:
- A Visualforce action or getter method
- A Web service method
- A trigger
The email that is sent has this format.
-------------------------------------------------------------------------------- Subject: Developer script exception from CLASSNAME Apex script unhandled trigger exception by user/organization: USER_ID/ORG_ID EXCEPTION_STRING STACK_TRACE --------------------------------------------------------------------------------
For example:
-------------------------------------------------------------------------------- From: Apex Application? <info@salesforce.com> To: joeuser@salesforce.com <joeuser@salesforce.com> Subject: Developer script exception from Gack WS? Date: Mon, 26 Nov 2007 14:42:41 +0000 (GMT) (06:42 PST) Apex script unhandled trigger exception by user/organization: 010x0000000rfPg/00Fx00000009ejj TestException.Test Exception?: Gack WS exception Class.Gack WS?.gackTestException: line 4, column 11 --------------------------------------------------------------------------------