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 |
|
|
#define SCALAR_float64 |
12 |
|
|
|
13 |
|
|
namespace crocoddyl { |
14 |
|
|
namespace python { |
15 |
|
|
|
16 |
|
✗ |
void exposeException() { |
17 |
|
|
#ifdef SCALAR_float64 |
18 |
|
|
bp::class_<Exception> ExceptionClass( |
19 |
|
✗ |
"Exception", bp::init<std::string, const char *, const char *, int>( |
20 |
|
✗ |
bp::args("self", "msg", "file", "func", "line"), |
21 |
|
✗ |
"Initialize the Crocoddyl's exception.")); |
22 |
|
✗ |
ExceptionClass.add_property("message", &Exception::getMessage) |
23 |
|
✗ |
.add_property("extra_data", &Exception::getExtraData); |
24 |
|
|
|
25 |
|
✗ |
ExceptionType = createExceptionClass("Exception"); |
26 |
|
✗ |
bp::register_exception_translator<Exception>(&translateException); |
27 |
|
|
#endif |
28 |
|
|
} |
29 |
|
|
|
30 |
|
|
} // namespace python |
31 |
|
|
} // namespace crocoddyl |
32 |
|
|
|