---
schema_version: "1"
id: 7318e8e914b763fb1e4af44a2e03b3183d42c3128bfd79e9a96aee7eb1ba427c
title: Handling Apex Exceptions in Managed Packages
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/code_handling_managed_errors.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.code_handling_managed_errors.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 8bfe38dd02e3a128d18e1bd0f9aa2fc93285e37dd11d82ad8353160b10fe6ddc
description: 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.
products:
  - Salesforce Platform
release: "264"
---
# Handling Apex Exceptions in Managed Packages

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

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Salesforce Classic (<a href="https://help.salesforce.com/s/articleView?id=xcloud.overview_edition_lex_only.htm&amp;type=5&amp;language=en_US" target="_blank">not available in all orgs</a>)</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Performance</strong>, <strong>Unlimited</strong>, <strong>Developer</strong>, and <strong>Enterprise</strong> Editions</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
      <colgroup>
        <col style="width:50%">
        <col style="width:50%">
      </colgroup>
      <thead class="slds-text-title_caps ">
        <tr class="">
          <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d42164e74">User Permissions Needed</th>
        </tr>
      </thead>
      <tbody>
        <tr class="">
          <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d42164e74 ">To create packages:</td>

          <td class="slds-cell-wrap" style="vertical-align:top;" headers="d42164e74 ">Create AppExchange Packages</td>

        </tr>
        <tr class="">
          <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d42164e74 ">To upload packages:</td>

          <td class="slds-cell-wrap" style="vertical-align:top;" headers="d42164e74 ">Upload AppExchange Packages</td>

        </tr>
        <tr class="">
          <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d42164e74 ">To create Apex:</td>

          <td class="slds-cell-wrap" style="vertical-align:top;" headers="d42164e74 ">Author Apex</td>

        </tr>
      </tbody>
    </table>

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 --------------------------------------------------------------------------------