Activity Forums Salesforce® Discussions How to explain exception handling in Salesforce?

  • Piyush

    Member
    August 26, 2019 at 7:46 am

    Hi Sirichandan,

    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.

    1. AsyncException:- Any problem with an asynchronous operation, such as failing to enqueue an asynchronous call.
    2. JSONException:- Any problem with JSON serialization and deserialization operations. For more information, see the methods of System.JSON, System.JSONParser, andSystem.JSONGenerator.
    3. XmlException:- Any problem with the XmlStream classes, such as failing to read or write XML.
    4. EmailException:- Any problem with email, such as failure to deliver. For more information, see Outbound Email.
    5. InvalidParameterValueException:- An invalid parameter was supplied for a method or any problem with a URL used with Visualforce pages. For more information on Visualforce, see the Visualforce Developer's Guide.
    6. BigObjectException:- Any problem with big object records, such as connection timeouts during attempts to access or insert big object records.
  • Saddam

    Member
    August 26, 2019 at 7:50 am

    Hi Sirichandan,

    Exception (fault) is an abnormal event that occurs generally after the execution of a program. It affects the normal program flow.
    →It is run time error through which execution is stopped
    → Another name for run time error is exception error, there are two types of errors

    Syntax error (or) Compile time
    Runtime error (or) exception
    → A compile-time (syntax) error occurs whenever we violate the syntax of the language
    → The only way to overcome this scenario is by changing the source code
    → In case of run time error, this might occur not due to programming error but because of run time
    → Environment such as

    Improper limits
    Lack of resources // insufficient memory
    Lack of connectivity
    → Such errors also stop the execution
    → In order to overcome run time errors and to continue with the execution of the programming language a mechanism is provided known as exception handling

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos