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)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 6 Jun 2019 14:20:32 +0000 (10:20 -0400)
commit4430bc809d78701c128ced642fb4e9597bc00ad0
treeac174390eecf2f5716fb7ba91325b3003b706961
parent7e4b80cc148d07716d605eb220f6f54aeddd9363
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.024712 seconds and 4 git commands to generate.