Error Handling in Salesforce.com :- In our previous Salesforce Developer Tutorial we have learned about Governor limits in Salesforce.com.In this Salesforce Visualforce Tutorial we are going to learn about Error Handling in salesforce.com. Through this Salesforce tutorial article we clearly lean how to handle errors in salesforce.com.

Error Handling in Salesforce.com

The main goal in Error Handling is to find uncaught errors in visualforce pages.While handling errors in visualforce we have to consider two factor. They are

  • How uncaught exceptions impacts the user interface.
  • How to communicate caught exception to users.

error handling

Uncaught Exceptions :- Force.com displays error messages to users in native user interface when uncaught exceptions are allowed in triggers. Allowing uncaught exceptions in triggers is one of the process to notify problems to the users. We have to use Try / Catch blocks are used for every action methods like SOQL, SOSL and DML statements in visualforce.

Error Communication :- In force.com visualforce provides data objects and page components like messsage, pagemessages for displaying the severity of the message to users on screen.