bt2: change some bt2.CreationError usages to ValueError
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 5 Jun 2019 18:11:37 +0000 (14:11 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 13 Jun 2019 21:24:21 +0000 (17:24 -0400)
commit116779e398ac2dbf096c13ce739e9bdae9fff499
treec061f5330aaccf1296e86c852255231a2b89484f
parent91335244d3b0e7c7b8da365a6ea6ecf939856ccd
bt2: change some bt2.CreationError usages to ValueError

The bt2.CreationError exception type is reserved for cases where the
creation functions return None/NULL, which is usually because of
exhausted memory.  Other exception types should be used for other
errors.

This patch fixes a few instances where bt2.CreationError is wrongly
used.  Change them for ValueError, since they are cases of wrong
parameter value passed by the user.  We have already used ValueError for
cases like these, for example in
_UserMessageIterator._create_packet_beginning_message.

Change-Id: Ib66943f8dc1200f7b589764c171bf4764741a6bd
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1383
Tested-by: jenkins
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
bindings/python/bt2/bt2/stream_class.py
bindings/python/bt2/bt2/trace.py
bindings/python/bt2/bt2/trace_class.py
tests/bindings/python/bt2/test_stream_class.py
tests/bindings/python/bt2/test_trace_class.py
This page took 0.027105 seconds and 4 git commands to generate.