Message ID | 20210923082527.81075-1-y.karadz@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | trace-cruncher: Fix the class 'event' constructor | expand |
diff --git a/tracecruncher/ft_utils.py b/tracecruncher/ft_utils.py index 1fc0648..b5f031a 100644 --- a/tracecruncher/ft_utils.py +++ b/tracecruncher/ft_utils.py @@ -46,6 +46,8 @@ class event: self.instance_list = [] if static: self.evt_id = find_event_id(system, name) + if self.evt_id < 0: + raise ValueError('Faild to find event {0}/{1}'.format(system, name)) else: self.evt_id = -1
The constructor must fail in the case when the event is not found on the system. Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com> --- tracecruncher/ft_utils.py | 2 ++ 1 file changed, 2 insertions(+)