# HG changeset patch # User drewp@bigasterisk.com # Date 1631901793 25200 # Node ID c04b5303eb081ae12a4693fa03eb6101d616fe75 # Parent 78024b27f9ec030e5513dc02a4f3a78960122fb2 try not to make empty topic subscriptions diff -r 78024b27f9ec -r c04b5303eb08 service/mqtt_to_rdf/mqtt_to_rdf.py --- a/service/mqtt_to_rdf/mqtt_to_rdf.py Fri Sep 17 11:01:06 2021 -0700 +++ b/service/mqtt_to_rdf/mqtt_to_rdf.py Fri Sep 17 11:03:13 2021 -0700 @@ -224,6 +224,10 @@ return n3 +class EmptyTopicError(ValueError): + pass + + class MqttStatementSource: def __init__(self, uri: URIRef, config: Graph, masterGraph: PatchableGraph, mqtt, internalMqtt, debugPageData, @@ -238,6 +242,8 @@ self.inference = inference self.mqttTopic = self.topicFromConfig(self.config) + if self.mqttTopic == b'': + raise EmptyTopicError(f"empty topic for {uri=}") log.debug(f'new mqttTopic {self.mqttTopic}') self.debugSub = {