This page redirects to an external site: https://developer.wordpress.org/reference/hooks/user_profile_update_errors/
On return, if the errors object contains errors then the save is not completed & the errors displayed to the user.
function check_fields($errors, $update, $user) {
$errors->add('demo_error',__('This is a demo error, and will halt profile save'));
}
add_action('user_profile_update_errors', 'check_fields', 10, 3);
This hook runs AFTER edit_user_profile_update and personal_options_update. If you want to validate some custom fields before saving, a workaround is to check the $errors array in this same callback, after performing your validations, and save the data if it is empty.
This hook can be found in wp-admin/includes/user.php
Return to Plugin API/Filter Reference