def handleAssignMessage(self, jsonMessage, objectToRead):
        if 'field' not in jsonMessage:
            raise MalformedMessageException(
                "incoming message missing 'field' field: " + str(jsonMessage)
                )

        if 'value' not in jsonMessage:
            raise MalformedMessageException(
                "incoming message missing 'value' field: " + str(jsonMessage)
                )

        field = jsonMessage['field']

        if not isinstance(field, str):
            raise MalformedMessageException(
                "incoming 'field' not a string: " + str(jsonMessage))

        field = intern(field)

        try:
            fieldDef = getattr(getObjectClass(objectToRead), field)
        except:
            raise InvalidFieldException()

        fieldDef = getattr(getObjectClass(objectToRead), field)

        if not Decorators.isPropertyToExpose(fieldDef):
            raise InvalidFieldException()

        if not Decorators.propertyHasSetter(fieldDef):
            return InvalidFieldException()

        try:
            setter = Decorators.getSetter(field, fieldDef)

            setter(objectToRead, jsonMessage['value'])

            return [{
                "messageId": jsonMessage["messageId"],
                "responseType": "OK"
                }]
        except Exception as e:
            return [unexpectedExceptionJson(jsonMessage, Exceptions.wrapException(e).message)]
dataset/ETHPy150Open ufora/ufora/ufora/BackendGateway/SubscribableWebObjects/MessageProcessor.py/MessageProcessor.handleAssignMessage/original