exam questions

Exam Certified Platform Developer II All Questions

View all questions & answers for the Certified Platform Developer II exam

Exam Certified Platform Developer II topic 1 question 24 discussion

Actual exam question from Salesforce's Certified Platform Developer II
Question #: 24
Topic #: 1
[All Certified Platform Developer II Questions]

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?

  • A. Add an onerror event handler to the tag.
  • B. Add an error-view component to the markup.
  • C. Use an AuraHandledException in a try/catch block.
  • D. Use ProcessBuilder to catch the error.
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
VVeguru
Highly Voted 1 year, 2 months ago
C, AuraHandled Exception is used to track the error when Apex is interacting with Lightning Component
upvoted 6 times
...
BrainMelt12
Most Recent 1 month, 1 week ago
Selected Answer: C
C. is correct due to internal server error vs client side error. A. might seem like a reasonable approach, but it does not directly address the issue of internal server errors caused by Apex exceptions. An "internal server error" originates from the server-side Apex controller, not the client-side JavaScript code. Since the error happens in Apex, the best way to provide a meaningful error message is inside Apex itself—which is exactly what AuraHandledException does.
upvoted 1 times
...
Jeet89123
4 months, 3 weeks ago
Selected Answer: A
We want to show more meaningfull message
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago