function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sunil2018sunil2018 

Exception handling best practice

Hi All,

need Exception handling best practice for below items
  1. seperate Exception handling class and use this class in other class
  2. Error handling class
  3. Error handling object
  4. Web service exception   501
  5. Exception handling best practice
  6. Sending alerts best methodology

Please suggest me some best methodoloty or best practice and provide some inputs with example for these items.
PriyaPriya (Salesforce Developers) 

Hi Sunil,

You have to use the Try Catch block in your classes. 
Kindly read all these documents which will answer your all queries :-

https://www.crmscience.com/single-post/2020/05/20/how-salesforce-developers-handle-errors-with-try-catch-rollback-best-practices

https://developer.salesforce.com/forums/?id=906F00000009BhUIAU

https://developer.salesforce.com/forums/?id=906F0000000Acq5IAC

https://developer.salesforce.com/forums/?id=906F00000008zhXIAQ

If the above information is helpful, please mark it as best answer.

Regards,

Priya Ranjan