μHAL (v2.8.17)
Part of the IPbus software repository
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
exceptions.cpp
Go to the documentation of this file.
1
3
4#include "pybind11/pybind11.h"
5
6// uhal includes
8#include "uhal/Node.hpp"
10#include "uhal/ProtocolUDP.hpp"
11#include "uhal/ValMem.hpp"
12
13
14namespace py = pybind11;
15
16
17void pycohal::wrap_exceptions(pybind11::module_& aModule)
18{
19 // Base uHAL exception (fallback for derived exceptions not wrapped)
20 auto baseException = py::register_exception<uhal::exception::exception>(aModule, "exception", PyExc_Exception);
21
22 // Derived uHAL exceptions
23 py::register_exception<uhal::exception::NonValidatedMemory> ( aModule, "NonValidatedMemory", baseException );
24 py::register_exception<uhal::exception::BulkTransferRequestedTooLarge> ( aModule, "BulkTransferRequestedTooLarge", baseException );
25 py::register_exception<uhal::exception::WriteAccessDenied> ( aModule, "WriteAccessDenied", baseException );
26 py::register_exception<uhal::exception::ReadAccessDenied> ( aModule, "ReadAccessDenied", baseException );
27 py::register_exception<uhal::exception::BitsSetWhichAreForbiddenByBitMask> ( aModule, "BitsSetWhichAreForbiddenByBitMask", baseException );
28 py::register_exception<uhal::exception::ValidationError> ( aModule, "ValidationError", baseException );
29 py::register_exception<uhal::exception::TcpTimeout> ( aModule, "TcpTimeout", baseException );
30 py::register_exception<uhal::exception::UdpTimeout> ( aModule, "UdpTimeout", baseException );
31 py::register_exception<pycohal::PycohalLogLevelEnumError> ( aModule, "PycohalLogLevelEnumError", baseException );
32}
void wrap_exceptions(pybind11::module_ &)
Wraps all uHAL exceptions (i.e. creates corresponding Python classes, and regsiters appropriate excep...
Definition: exceptions.cpp:17