Correct way of showing errors when editing profile via front-end form? I've been looking at the following resources:

https://craftcms.com/docs/templating/user-profile-form

Allow user to change or delete their photo for their profile from the front end

Front end edit: entry doesn’t get saved

Front end registration form, no errors

To try and put together a profile editing page that returns errors once submitted, but can't seem to get it.

user is equal to either the currentUser or craft.users.id(craft.request.getSegment(3)).first()

&lt;form method="post" accept-charset="UTF-8" enctype="multipart/form-data"&gt;

{{ getCsrfInput() }}
&lt;input type="hidden" name="action" value="users/saveUser"&gt;
&lt;input type="hidden" name="redirect" value="partners/view/{{ user.id }}"&gt;
&lt;input type="hidden" name="userId" value="{{ user.id }}"&gt;

{% macro errorList(errors) %}
    {% if errors %}
        &lt;ul class="errors"&gt;
            {% for error in errors %}
                &lt;li&gt;{{ error }}&lt;/li&gt;
            {% endfor %}
        &lt;/ul&gt;
    {% endif %}
{% endmacro %}

{% from _self import errorList %}

{{ dump(user.getErrors) }}

&lt;div class="row"&gt;
    &lt;div class="col-xs-12 col-sm-6"&gt;
        &lt;label for="firstName"&gt;First Name:&lt;/label&gt;
        &lt;input id="firstName" name="firstName" autocomplete="off" type="text" data-parsley-required="true" value="{{ user.firstName }}"&gt;
        {{ errorList(user.getErrors('firstName')) }}
    &lt;/div&gt;
    &lt;div class="col-xs-12 col-sm-6"&gt;
        &lt;label for="lastName"&gt;Last Name:&lt;/label&gt;
        &lt;input id="lastName" name="lastName" autocomplete="off" type="text" data-parsley-required="true" value="{{ user.lastName }}"&gt;
        {{ errorList(user.getErrors('lastName')) }}
    &lt;/div&gt;
&lt;/div&gt;

&lt;div class="row"&gt;
    &lt;div class="col-xs-12"&gt;
        &lt;label for="email"&gt;Email:&lt;/label&gt;
        &lt;input id="email" name="email" autocomplete="off" type="email" data-parsley-required="true" data-parsley-type="email" value="{{ user.email }}"&gt;
        {{ errorList(user.getErrors('email')) }}
    &lt;/div&gt;
&lt;/div&gt;

&lt;div class="row"&gt;
    &lt;div class="col-xs-12"&gt;
        &lt;label for="userPhoto"&gt;User Photo:&lt;/label&gt;
        {% if user.photoUrl %}
            &lt;img src="{{ user.photoUrl }}" id="userPhoto" width="100" height="100" /&gt;
            &lt;input type="hidden" name="deleteUserPhoto" id="deleteUserPhotoInput" value=""&gt;
        {% else %}
            &lt;img src="{{ currentUserPhotoUrl }}" width="100" height="100"  alt="No User Photo" /&gt;
        {% endif %}
            &lt;input id="profilePhoto" type="file" accept="image/*" capture="camera" name="userPhoto" value="{{ (user.photoUrl ? 'Change Photo' : 'Upload') }}"&gt;
        {% if user.photoUrl %}
            &lt;a id="btn-delete-user-photo" class="btn btn-solid btn-xs"&gt;Delete&lt;/a&gt;
        {% endif %}
    &lt;/div&gt;
&lt;/div&gt;

&lt;div class="row"&gt;
    &lt;div class="col-xs-12"&gt;
        &lt;label for="userDescription"&gt;User Description&lt;/label&gt;
        &lt;textarea id="userDescription" name="fields[userDescription]" autocomplete="off" data-parsley-required="true" value="{{ user.userDescription }}"&gt;&lt;/textarea&gt;
    &lt;/div&gt;
&lt;/div&gt;

&lt;button type="submit" class="btn btn-solid"&gt;Save&lt;/button&gt;

&lt;/form&gt;


Could anyone point out where I'm going wrong, or provide a working example?

Many thanks!
Not sure what validation error you're expecting from the template code.

Both firstName and lastName are non-required fields that will basically accept any input.

photoUrl could return a validation error if, for example, you tried to upload a .txt file to but you're not calling the errorList() macro on that field.

Not sure if userDescription is required or not, but the errorList() macro isn't being called there, either.

Finally, the variable that Craft returns back to the template when there are validation errors is called account.

So you'd want to do something similar to what the User Registration Form example doc does:

 {% if account is defined %}
    {{ errorList(account.getErrors('userDescription')) }}
{% endif %}