def add_state_errors(self, errors):
if not self.errors:<EOL><INDENT>self.errors = dict()<EOL><DEDENT>if '<STR_LIT>' not in self.errors:<EOL><INDENT>self.errors['<STR_LIT>'] = []<EOL><DEDENT>if type(errors) is not list:<EOL><INDENT>errors = [errors]<EOL><DEDENT>for error in errors:<EOL><INDENT>if not isinstance(error, Error):<EOL><INDENT>err = '<STR_LIT>'<EOL>raise x.InvalidErrorType(err.format(Error))<EOL><DEDENT>self.errors['<STR_LIT>'].append(error)<EOL><DEDENT>return self<EOL>
Add state errors
Accepts a list of errors (or a single Error) coming from validators
applied to entity as whole that are used for entity state validation
The errors will exist on a  __state__ property of the errors object.

:param errors: list or Error, list of entity state validation errors
:return: shiftschema.result.Result