def _create_from_ptr(ptr):
msg_type = native_bt.message_get_type(ptr)
-
- if msg_type not in _MESSAGE_TYPE_TO_CLS:
- raise bt2.Error('unknown message type: {}'.format(msg_type))
-
return _MESSAGE_TYPE_TO_CLS[msg_type]._create_from_ptr(ptr)
@staticmethod
def _check_has_default_clock_class(clock_class):
if clock_class is None:
- raise bt2.NonexistentClockSnapshot(
+ raise ValueError(
'cannot get default clock snapshot: stream class has no default clock class'
)
def _check_has_default_clock_snapshots(self):
if not self._has_default_clock_snapshots:
- raise bt2.NonexistentClockSnapshot(
+ raise ValueError(
'cannot get default clock snapshot: such a message has no clock snapshots for this stream class'
)