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 |
✓✗ |
20 |
"Exception", bp::init<std::string, const char *, const char *, int>( |
17 |
✓✗ |
10 |
bp::args("self", "msg", "file", "func", "line"), |
18 |
✓✗ |
20 |
"Initialize the Crocoddyl's exception.")); |
19 |
✓✗ |
10 |
ExceptionClass.add_property("message", &Exception::getMessage) |
20 |
✓✗ |
10 |
.add_property("extra_data", &Exception::getExtraData); |
21 |
|
|
|
22 |
✓✗ |
10 |
ExceptionType = createExceptionClass("Exception"); |
23 |
✓✗ |
10 |
bp::register_exception_translator<Exception>(&translateException); |
24 |
|
10 |
} |
25 |
|
|
|
26 |
|
|
} // namespace python |
27 |
|
|
} // namespace crocoddyl |