Raise AttributeError on invalid message attributes.

Current behavior is to infinitely recurse until RuntimeError: maximum recursion depth exceeded