Salesforce Development Tutorial - A Complete Guide to Exception Handling in Apex and LWC's
Coding With The Force Coding With The Force
15K subscribers
5,919 views
185

 Published On Premiered Jan 24, 2022

In this episode we go over everything you need to know about exception handling in both Apex and Lightning Web Components. Knowing how to do this will result in better more consistent error messaging for your users and higher quality and easier to maintain code! Exception handling is often overlooked in Salesforce development and it's a shame because it brings so much to the table that to create higher quality user experiences that you otherwise wouldn't have.

LWC Modules Tutorial:    • Salesforce Developer Tutorial (LWC): ...  
Domain Layer Tutorial:    • Salesforce SoC and Apex Common Tutori...  
Service Layer Tutorial:    • Salesforce SoC and Apex Common Tutori...  

Please consider donating to help continue to improve the content produced for Coding With The Force: https://www.paypal.com/donate?busines...

Get Coding With The Force Merch Here: https://my-store-d20559.creator-sprin...


Follow all of our social media here:

Patreon:   / codingwiththeforce  
Github: https://github.com/Coding-With-The-Force
Facebook:   / codingwiththeforce  
Twitter:   / coding_force  
Instagram:   / codingwiththeforce  

Salesforce development books I recommend:

Advanced Apex Programming: https://amzn.to/3lXi8to
Salesforce Lightning Platform Enterprise Architecture: https://amzn.to/2R0D4BQ
Mastering Salesforce DevOps: https://amzn.to/3lTtTRN
Apex Design Patterns Book: https://amzn.to/3DwqljP


Good Non-SF Specific Development Books:

Clean Code: https://amzn.to/35PuMDU
Clean Architecture: https://amzn.to/35FYo6A
Design Patterns: Elements of Reusable Object-Oriented Software Book: https://amzn.to/3LhvHBd

-----------------------------------------------------------------------------------------------------------------------

Table of Contents:

0:00 - Intro
0:21 - What we're covering in this video
0:46 - How to be entered to win free certs!
1:27 - What is an Exception and Why care about them?
2:27 - Examples of why you should use exception handling
5:42 - Apex Trigger exception handling example
8:50 - Try/Catch/Finally block explanation
14:48 - Why to use specific exception types in Catch Blocks
21:50 - The exceptions Salesforce won't let you handle yourself
25:14 - Handling errors in LWC's
36:27 - How to Create and When to use Custom Apex Exceptions
41:49 - Why use custom exceptions instead of returning strings
48:39 - How to handle exceptions in JavaScript
50:25 - Creating a try/catch/finally block to handle errors in JS
53:41 - Creating a custom exception type in JavaScript
1:01:40 - Outro

DISCLAIMER: The views and ideas expressed on this YouTube channel and blog are based on past development experiences and may not always work for your particular scenarios. The advice in these videos may also become outdated as technology advances. They should be used as examples for educational purposes only. Using any shown solutions in your own org is not advisable since they are example scenarios.

#salesforce #salesforcedeveloper #salesforceadmin

show more

Share/Embed