bt2: prepend underscore to exceptions not meant to be raised by user
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 24 Jul 2019 01:56:58 +0000 (21:56 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 7 Aug 2019 18:05:19 +0000 (14:05 -0400)
commit614743a5d5d7e661bf95abda9d81468c1d67c030
tree80bc69021b90eae7c174419ed4c1f6a113da0feb
parent493428a0e391525646df54b91b63f295f565eb26
bt2: prepend underscore to exceptions not meant to be raised by user

The exceptions Error, MemoryError and LoadingError are only meant to be
raised by the Python bindings, in response to corresponding status codes
from the Babeltrace API.  As per our convention, names of classes not
meant to be instantiated directly by the user are prepended with an
underscore, so change these accordingly.

Note that they are still accessible to the user if they need to catch
an exception:

    try:
        ...
    except bt2._Error:
        ...

Change-Id: If094d817dac3c507b6bf3e1e794373f1c7fc33e4
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1752
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
20 files changed:
src/bindings/python/bt2/bt2/__init__.py.in
src/bindings/python/bt2/bt2/component.py
src/bindings/python/bt2/bt2/error.py
src/bindings/python/bt2/bt2/field_class.py
src/bindings/python/bt2/bt2/graph.py
src/bindings/python/bt2/bt2/integer_range_set.py
src/bindings/python/bt2/bt2/message_iterator.py
src/bindings/python/bt2/bt2/native_bt_component_class.i
src/bindings/python/bt2/bt2/port.py
src/bindings/python/bt2/bt2/query_executor.py
src/bindings/python/bt2/bt2/stream.py
src/bindings/python/bt2/bt2/trace.py
src/bindings/python/bt2/bt2/trace_class.py
src/bindings/python/bt2/bt2/utils.py
src/bindings/python/bt2/bt2/value.py
tests/bindings/python/bt2/test_component_class.py
tests/bindings/python/bt2/test_error.py
tests/bindings/python/bt2/test_graph.py
tests/bindings/python/bt2/test_message_iterator.py
tests/bindings/python/bt2/test_query_executor.py
This page took 0.026569 seconds and 4 git commands to generate.