---
schema_version: "1"
id: a3d2c1bb5d20854035bdc342cc97a097f020f55e124a148ced00dd40e5b19cd6
title: Site Exceptions
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_Site_exceptions.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_Site_exceptions.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 0cd3da0ef63c8852c2a4729c0aac9912dced6116e7a316ee73337a4ebadef410
description: The Site namespace contains an exception class.
---
# Site Exceptions

The Site namespace contains an exception class.

All exception classes support built-in methods for returning the error message and exception type. See [Exception Class and Built-In Exceptions](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_classes_exception_methods.htm "An exception denotes an error that disrupts the normal flow of code execution. You can use Apex built-in exceptions or create custom exceptions. All exceptions have common methods.").

The Site namespace contains this exception:

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader vertical-align-top " id="d1526276e66">Exception</th>

              <th class="featureTableHeader vertical-align-top " id="d1526276e69">Description</th>

              <th class="featureTableHeader vertical-align-top " id="d1526276e72">Methods</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d1526276e66" data-title="Exception"><samp class="codeph apex_code">Site.ExternalUserCreateException</samp></td>

              <td class="entry" headers="d1526276e69" data-title="Description">Unable to create external user</td>

              <td class="entry" headers="d1526276e72" data-title="Methods">Use the <samp class="codeph apex_code"><span class="keyword">String</span> getMessage()</samp> to get the error
                message and write it to debug log.<p class="p">Use <samp class="codeph apex_code">List&lt;<span class="keyword">String</span>&gt;
                    getDisplayMessages()</samp> to get a list of errors displayed to the end
                  user.</p>
                <p class="p">This exception can’t be subclassed or thrown in code.</p>
              </td>

            </tr>

          </tbody>

        </table>