OPAL (Object Oriented Parallel Accelerator Library)
2024.2
OPAL
ExceptionTranslation.cpp
Go to the documentation of this file.
1
//
2
// Python API for PolynomialCoefficient (part of the multidimensional polynomial fitting routines)
3
//
4
// Copyright (c) 2008-2023, Chris Rogers, STFC Rutherford Appleton Laboratory, Didcot, UK
5
//
6
// This file is part of OPAL.
7
//
8
// OPAL is free software: you can redistribute it and/or modify
9
// it under the terms of the GNU General Public License as published by
10
// the Free Software Foundation, either version 3 of the License, or
11
// (at your option) any later version.
12
//
13
// You should have received a copy of the GNU General Public License
14
// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
15
//
16
17
#include "
Classic/Utilities/ClassicException.h
"
18
#include "
Utilities/OpalException.h
"
19
#include "
PyOpal/PyCore/ExceptionTranslation.h
"
20
21
namespace
PyOpal
{
22
namespace
ExceptionTranslation
{
23
void
registerExceptions
() {
24
// handle std::exception (e.g. for IO errors)
25
py::register_exception_translator<std::exception>(
translateException<std::exception>
);
26
// handle Opal exceptions (they all inherit from ClassicException)
27
py::register_exception_translator<ClassicException>(
translateOpalException<ClassicException>
);
28
}
29
}
30
}
ExceptionTranslation.h
ClassicException.h
OpalException.h
PyOpal
Definition
ExceptionTranslation.cpp:21
PyOpal::ExceptionTranslation
Definition
ExceptionTranslation.cpp:22
PyOpal::ExceptionTranslation::translateOpalException
void translateOpalException(T const &exception)
Definition
ExceptionTranslation.h:45
PyOpal::ExceptionTranslation::registerExceptions
void registerExceptions()
Definition
ExceptionTranslation.cpp:23
PyOpal::ExceptionTranslation::translateException
void translateException(T const &exception)
Definition
ExceptionTranslation.h:39