bt2: make bt2.Error wrap current thread's error
[babeltrace.git] / src / bindings / python / bt2 / bt2 / trace_collection_message_iterator.py
index 592c7f157ab9827b88fe02a8dbb4b7544c072652..1b68d20523dba054a1f6f70177e622e1023196dc 100644 (file)
@@ -49,7 +49,7 @@ class ComponentSpec:
         self._logging_level = logging_level
 
         if type(params) is str:
-            self._params = bt2.create_value({'paths': [params]})
+            self._params = bt2.create_value({'inputs': [params]})
         else:
             self._params = bt2.create_value(params)
 
@@ -141,19 +141,19 @@ class TraceCollectionMessageIterator(bt2.message_iterator._MessageIterator):
 
     def _create_stream_intersection_trimmer(self, component, port):
         # find the original parameters specified by the user to create
-        # this port's component to get the `path` parameter
+        # this port's component to get the `inputs` parameter
         for src_comp_and_spec in self._src_comps_and_specs:
             if component == src_comp_and_spec.comp:
                 break
 
         try:
-            paths = src_comp_and_spec.spec.params['paths']
+            inputs = src_comp_and_spec.spec.params['inputs']
         except Exception as e:
-            raise bt2.Error(
-                'all source components must be created with a "paths" parameter in stream intersection mode'
+            raise ValueError(
+                'all source components must be created with an "inputs" parameter in stream intersection mode'
             ) from e
 
-        params = {'paths': paths}
+        params = {'inputs': inputs}
 
         # query the port's component for the `trace-info` object which
         # contains the stream intersection range for each exposed
@@ -178,7 +178,7 @@ class TraceCollectionMessageIterator(bt2.message_iterator._MessageIterator):
             pass
 
         if begin is None or end is None:
-            raise bt2.Error(
+            raise RuntimeError(
                 'cannot find stream intersection range for port "{}"'.format(port.name)
             )
 
@@ -189,10 +189,10 @@ class TraceCollectionMessageIterator(bt2.message_iterator._MessageIterator):
         plugin = bt2.find_plugin('utils')
 
         if plugin is None:
-            raise bt2.Error('cannot find "utils" plugin (needed for the muxer)')
+            raise RuntimeError('cannot find "utils" plugin (needed for the muxer)')
 
         if 'muxer' not in plugin.filter_component_classes:
-            raise bt2.Error(
+            raise RuntimeError(
                 'cannot find "muxer" filter component class in "utils" plugin'
             )
 
@@ -203,10 +203,10 @@ class TraceCollectionMessageIterator(bt2.message_iterator._MessageIterator):
         plugin = bt2.find_plugin('utils')
 
         if plugin is None:
-            raise bt2.Error('cannot find "utils" plugin (needed for the trimmer)')
+            raise RuntimeError('cannot find "utils" plugin (needed for the trimmer)')
 
         if 'trimmer' not in plugin.filter_component_classes:
-            raise bt2.Error(
+            raise RuntimeError(
                 'cannot find "trimmer" filter component class in "utils" plugin'
             )
 
@@ -242,7 +242,7 @@ class TraceCollectionMessageIterator(bt2.message_iterator._MessageIterator):
         plugin = bt2.find_plugin(comp_spec.plugin_name)
 
         if plugin is None:
-            raise bt2.Error('no such plugin: {}'.format(comp_spec.plugin_name))
+            raise ValueError('no such plugin: {}'.format(comp_spec.plugin_name))
 
         if comp_cls_type == _CompClsType.SOURCE:
             comp_classes = plugin.source_component_classes
@@ -251,7 +251,7 @@ class TraceCollectionMessageIterator(bt2.message_iterator._MessageIterator):
 
         if comp_spec.class_name not in comp_classes:
             cc_type = 'source' if comp_cls_type == _CompClsType.SOURCE else 'filter'
-            raise bt2.Error(
+            raise ValueError(
                 'no such {} component class in "{}" plugin: {}'.format(
                     cc_type, comp_spec.plugin_name, comp_spec.class_name
                 )
This page took 0.024296 seconds and 4 git commands to generate.