Check for errors (any) on guest entry form (Craft 3) I have a guest entry form that's working fine. I'm using Craft-supplied code:

{% macro errorList(errors) %}
  {% if errors %}
    {% for error in errors %}
      {{ error }}{% if not loop.last %}, {% endif %} 
    {% endfor %}
  {% endif %}
{% endmacro %}


And it works fine - field by field:

{% if entry is defined %}
  &lt;p class="help alert"&gt;{{ errorList(entry.getErrors('title')) }}&lt;/p&gt;
{% endif %}


But I can't figure out how to check if there are any errors (and error in any field) so I can display a notification at the top of the page: "There were some problems with your submission".

{% if errorList(entry.getErrors())|length }}


doesn't work.
You can use this 

{% if entry.hasErrors() %}
    Render a message here
{% endif %}