def encodeSubscriptionChangesAsJsonAndDrop(self, changedSubscriptionIds):
        result = []

        for messageId in changedSubscriptionIds:
            value = self.subscriptions.getValueAndDropSubscription(messageId)

            try:
                if isinstance(value, Exceptions.SubscribableWebObjectsException):
                    valueResponseJson = {
                        "messageId": messageId,
                        "responseType": "Exception",
                        "message": value.message
                        }
                else:
                    valueResponseJson = {
                        "messageId": messageId,
                        "responseType": "ValueChanged",
                        "value": self.outgoingObjectCache.convertResponseToJson(value)
                        }
            except:
                guid = uuid.uuid4()
                logging.error(
                    "Exception occurred converting subscription value to json. guid = %s. tb =\n%s",
                    guid,
                    traceback.format_exc()
                    )

                valueResponseJson = {
                    "messageId": messageId,
                    "responseType": "Exception",
                    "message": "Error converting result to json. guid = %s" % guid
                    }

            result.append(valueResponseJson)

        return result
dataset/ETHPy150Open ufora/ufora/ufora/BackendGateway/SubscribableWebObjects/MessageProcessor.py/MessageProcessor.encodeSubscriptionChangesAsJsonAndDrop/original