Certified Platform Developer II Exam QuestionsBrowse all questions from this exam

Certified Platform Developer II Exam - Question 23


A user receives the generic "An internal server error has occurred" while interacting with a custom Lightning Component.

What should the developer do to ensure a more meaningful message?

Show Answer
Correct Answer: C

To ensure a more meaningful error message in a custom Lightning Component, the developer should use an AuraHandledException in a try/catch block. AuraHandledException allows developers to throw custom error messages from Apex code, which can then be caught and displayed in a more user-friendly manner within the Lightning Component. This approach provides a controlled way to handle exceptions and communicate them effectively to the user.

Discussion

2 comments
Sign in to comment
VVeguruOption: C
Jul 20, 2023

C, AuraHandled Exception is used to track the error when Apex is interacting with Lightning Component

Jeet89123Option: A
May 29, 2024

We want to show more meaningfull message