Activity Forums Salesforce® Discussions What are various standard exceptions that salesforce throws?

  • Manpreet

    Member
    April 28, 2017 at 1:26 pm

    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

  • Suraj

    Member
    April 28, 2017 at 1:27 pm

    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.

Popular Salesforce Blogs

Popular Salesforce Videos