def validate(self):
        """
        Validate all written messages.

        Does minimal validation of types, and for messages with corresponding
        serializers use those to do additional validation.

        As a side-effect, the messages are replaced with their serialized
        contents.

        @raises TypeError: If a field name is not unicode, or the dictionary
            fails to serialize to JSON.

        @raises eliot.ValidationError: If serializer was given and validation
            failed.
        """
        for dictionary, serializer in zip(self.messages, self.serializers):
            try:
                self._validate_message(dictionary, serializer)
            except (TypeError, ValidationError) as e:
                # We already figured out which messages failed validation
                # earlier. This just lets us figure out which exception type to
                # raise.
                raise e.__class__("\n\n".join(self._failed_validations))