Activity › Forums › Salesforce® Discussions › What are various standard exceptions that salesforce throws?
-
What are various standard exceptions that salesforce throws?
Posted by Saurabh on April 27, 2017 at 2:29 PMWhat are various standard exceptions that salesforce throws?
Suraj replied 9 years ago 3 Members · 2 Replies -
2 Replies
-
Hi saurabh,
Standard exceptions that salesforce throws :
DmlException
ListException
NullPointerException
QueryException
SObjectException
You can use common exception methods to get more information about an exception, such as the exception error message or the stack trace. The previous example calls the getMessage method, which returns the error message associated with the exception. There are other exception methods that are also available. Here are descriptions of some useful methods:
getCause: Returns the cause of the exception as an exception object.
getLineNumber: Returns the line number from where the exception was thrown.
getMessage: Returns the error message that displays for the user.
getStackTraceString: Returns the stack trace as a string.
getTypeName: Returns the type of exception, such as DmlException, ListException, MathException, and so on.Thanks
- [adinserter block='9']
-
Hi Saurabh,
There are number of Exception,
- AsyncException
Any problem with an asynchronous operation, such as failing to enqueue an asynchronous call.
- CalloutException
Any problem with a Web service operation, such as failing to make a callout to an external system.
- DmlException
Any problem with a DML statement, such as an insert statement missing a required field on a record.
- JSONException
Any problem with JSON serialization and deserialization operations.
For full list of Exception use this link
Log In to reply.