What are the apex exceptions?

185    Asked by DavidEdmunds in Salesforce , Asked on May 4, 2023

 I have read the documentation and searched but can't seem to find an answer to this.


I am creating a method for a portal. I need to pass any errors back to the front end portal in a way that the front end designer can present them to the user in a way the user will understand (instead of the raw error message).


I want to map friendly messages to the common exceptions we might expect to get. But short of causing the code to error and reading the message I can't find a way to find all possible messages.


Is there not somewhere a reference of all possible errors? I can find how to catch DML errors, but I can't find any reference of what all the possible return messages might be.

Answered by Claudine Tippins

Below is a list of apex exceptions -


AsyncException
CalloutException
DmlException
EmailException
ExternalObjectException
InvalidParameterValueException
LimitException
JSONException
ListException
MathException
NoAccessException
NoDataFoundException
NoSuchElementException
NullPointerException
QueryException
RequiredFeatureMissing
SearchException
SecurityException
SerializationException
SObjectException
StringException
TypeException
VisualforceException
XmlException


Your Answer

Interviews

Parent Categories