ExceptionTranslators.h
Go to the documentation of this file.
/*****************************************************************************
*
* Copyright (c) 2003-2020 by The University of Queensland
* http://www.uq.edu.au
*
* Primary Business: Queensland, Australia
* Licensed under the Apache License, version 2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Development until 2012 by Earth Systems Science Computational Center (ESSCC)
* Development 2012-2013 by School of Earth Sciences
* Development from 2014-2017 by Centre for Geoscience Computing (GeoComp)
* Development from 2019 by School of Earth and Environmental Sciences
**
*****************************************************************************/
#ifndef __ESCRIPT_EXCEPTIONTRANSLATORS_H__
#define __ESCRIPT_EXCEPTIONTRANSLATORS_H__
#include "system_dep.h"
#include "DataTypes.h"
#include "EsysException.h"
// put this within all boost module definitions so exceptions are translated
// properly
#define REGISTER_ESCRIPT_EXCEPTION_TRANSLATORS \
register_exception_translator<escript::AssertException>(&escript::AssertionErrorTranslator);\
register_exception_translator<escript::IOError>(&escript::IOErrorTranslator);\
register_exception_translator<escript::NotImplementedError>(&escript::NotImplementedErrorTranslator);\
register_exception_translator<escript::ValueError>(&escript::ValueErrorTranslator)
namespace escript {
ESCRIPT_DLL_API
void AssertionErrorTranslator(const EsysException& e);
ESCRIPT_DLL_API
void IOErrorTranslator(const EsysException& e);
ESCRIPT_DLL_API
void NotImplementedErrorTranslator(const EsysException& e);
ESCRIPT_DLL_API
void RuntimeErrorTranslator(const EsysException& e);
ESCRIPT_DLL_API
void ValueErrorTranslator(const EsysException& e);
} // end of namespace
#endif // __ESCRIPT_EXCEPTIONTRANSLATORS_H__
DataTypes.h
EsysException.h
ESCRIPT_DLL_API
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:30
escript
Definition: AbstractContinuousDomain.cpp:23
escript::RuntimeErrorTranslator
void RuntimeErrorTranslator(const EsysException &e)
Function which translates an EsysException into a python RuntimeError.
Definition: ExceptionTranslators.cpp:37
escript::ValueErrorTranslator
void ValueErrorTranslator(const EsysException &e)
Function which translates an EsysException into a python ValueError.
Definition: ExceptionTranslators.cpp:42
escript::AssertionErrorTranslator
void AssertionErrorTranslator(const EsysException &e)
Function which translates an EsysException into a python AssertionError.
Definition: ExceptionTranslators.cpp:22
escript::IOErrorTranslator
void IOErrorTranslator(const EsysException &e)
Function which translates an EsysException into a python IOError.
Definition: ExceptionTranslators.cpp:27
escript::NotImplementedErrorTranslator
void NotImplementedErrorTranslator(const EsysException &e)
Function which translates an EsysException into a python NotImplementedError.
Definition: ExceptionTranslators.cpp:32
system_dep.h