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

How to catch server error in JS for LWC

How can I catch the server error message in JS for LWC. I have a trigger for object A and for this object I have LWC where I adding new records. Trigger checking whether percents on object is equal 100. When record has less than 100% show message "ABC".
I would like to get the same error message when I creating new record using LWC. How may I do this using JS for LWC ?
Thanks !
Anil Bolisetty 2Anil Bolisetty 2
Use throw new aurahandled excpetion in apex and catch in error statement in lwc js