Directory: | ./ |
---|---|
File: | bindings/python/crocoddyl/core/utils/excepton.cpp |
Date: | 2025-01-16 08:47:40 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 9 | 9 | 100.0% |
Branches: | 7 | 14 | 50.0% |
Line | Branch | Exec | Source |
---|---|---|---|
1 | /////////////////////////////////////////////////////////////////////////////// | ||
2 | // BSD 3-Clause License | ||
3 | // | ||
4 | // Copyright (C) 2023-2023, Heriot-Watt University | ||
5 | // Copyright note valid unless otherwise stated in individual files. | ||
6 | // All rights reserved. | ||
7 | /////////////////////////////////////////////////////////////////////////////// | ||
8 | |||
9 | #include "python/crocoddyl/core/utils/exception.hpp" | ||
10 | |||
11 | namespace crocoddyl { | ||
12 | namespace python { | ||
13 | |||
14 | 10 | void exposeException() { | |
15 | bp::class_<Exception> ExceptionClass( | ||
16 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
20 | "Exception", bp::init<std::string, const char *, const char *, int>( |
17 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::args("self", "msg", "file", "func", "line"), |
18 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | "Initialize the Crocoddyl's exception.")); |
19 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | ExceptionClass.add_property("message", &Exception::getMessage) |
20 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | .add_property("extra_data", &Exception::getExtraData); |
21 | |||
22 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | ExceptionType = createExceptionClass("Exception"); |
23 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::register_exception_translator<Exception>(&translateException); |
24 | 10 | } | |
25 | |||
26 | } // namespace python | ||
27 | } // namespace crocoddyl | ||
28 |