'Add an error.
Duplicate errors (those with the same code and field) will have the
last `details` stored.
:param error: The error to be set.
:param field: where the error came from (generally "body" or "ua")
:param details: additional error info (for the event)
:type error: :py:class:`SignatureError`
:type field: str or None
:type details: object'

def add_error(self, error, field=None, details=None):

    self.errors[(error.code, field)] = details
