bt2: prepend underscore to exceptions not meant to be raised by user
[babeltrace.git] / src / bindings / python / bt2 / bt2 / component.py
index f31842181aa196dc81e681130ab8a796f7a5e7d5..6d6afc4bb70df6f4e9849129e9a5820f4ecaf039 100644 (file)
@@ -499,7 +499,7 @@ class _UserComponentType(type):
             )
 
         if cc_ptr is None:
-            raise bt2.CreationError(
+            raise bt2._MemoryError(
                 "cannot create component class '{}'".format(class_name)
             )
 
@@ -522,7 +522,7 @@ class _UserComponentType(type):
         return self
 
     def __call__(cls, *args, **kwargs):
-        raise bt2.Error(
+        raise RuntimeError(
             'cannot directly instantiate a user component from a Python module'
         )
 
@@ -677,7 +677,7 @@ class _UserComponent(metaclass=_UserComponentType):
         tc_ptr = native_bt.trace_class_create(ptr)
 
         if tc_ptr is None:
-            raise bt2.CreationError('could not create trace class')
+            raise bt2._MemoryError('could not create trace class')
 
         tc = bt2._TraceClass._create_from_ptr(tc_ptr)
         tc._assigns_automatic_stream_class_id = assigns_automatic_stream_class_id
@@ -698,7 +698,7 @@ class _UserComponent(metaclass=_UserComponentType):
         cc_ptr = native_bt.clock_class_create(ptr)
 
         if cc_ptr is None:
-            raise bt2.CreationError('could not create clock class')
+            raise bt2._MemoryError('could not create clock class')
 
         cc = bt2.clock_class._ClockClass._create_from_ptr(cc_ptr)
 
This page took 0.02371 seconds and 4 git commands to generate.