Move error details parsing to a state object in the Python parser.