What's the number of times the letter "u" appears in:
Q: Error Handling in methods that return account I have an Apex method that receives an Account record as input and returns Account record. What if an error occurs and i want to return it to the user? I cannot return String, since the method returns Account.
Any ideas ?

A: Based on your comment, you are looking for a way to return custom error message to User in your Lightning Component. One solution would be to use AuraHandledException in your Apex controller. Then you can throw this exception and pass String argument to helper which will display it to the User.
Apex controller:
@AuraEnabled public static List<String> matchingService(Account acc) {
    List<String> returnList = new List<String>();
    try {
    //perform some logic on returnList
    } catch (Exception ex) {
        throw new AuraHandledException('You cannot perform this action, error occured: ' + ex.getMessage);
    } 
    return returnList;

}

JS Helper:
myFunction: function (component, account) {
        var action = component.get("c.matchingService");
        var account;

        action.setParams({
            "acc": account,
        });

        action.setCallback(this, function (response) {
            var state = response.getState();
            if (state === "SUCCESS") {
                var stringList = response.getReturnValue();
            } else {
                //errorMessage is the String argument of AuraHandledException
                var errorMessage = response.getError()[0].message;
                console.log('Error in matchingService : ' + errorMessage);

                //Handle error - for example show toast with message from Apex controller
                helper.showToast(component, errorMessage);
            }

        });
        $A.enqueueAction(action);
    }


user
There are 49 "u"s in the text you provided.
assistant