escript  Revision_
ExceptionTranslators.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2016 by The University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Apache License, version 2.0
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development 2012-2013 by School of Earth Sciences
13 * Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 *
15 *****************************************************************************/
16 
17 #ifndef __ESCRIPT_EXCEPTIONTRANSLATORS_H__
18 #define __ESCRIPT_EXCEPTIONTRANSLATORS_H__
19 
20 #include "DataTypes.h"
21 #include "EsysException.h"
22 
23 // put this within all boost module definitions so exceptions are translated
24 // properly
25 #define REGISTER_ESCRIPT_EXCEPTION_TRANSLATORS \
26  register_exception_translator<escript::AssertException>(&escript::AssertionErrorTranslator);\
27  register_exception_translator<escript::IOError>(&escript::IOErrorTranslator);\
28  register_exception_translator<escript::NotImplementedError>(&escript::NotImplementedErrorTranslator);\
29  register_exception_translator<escript::ValueError>(&escript::ValueErrorTranslator)
30 
31 namespace escript {
32 
37  void AssertionErrorTranslator(const EsysException& e);
38 
43  void IOErrorTranslator(const EsysException& e);
44 
49  void NotImplementedErrorTranslator(const EsysException& e);
50 
55  void RuntimeErrorTranslator(const EsysException& e);
56 
61  void ValueErrorTranslator(const EsysException& e);
62 
63 } // end of namespace
64 
65 #endif // __ESCRIPT_EXCEPTIONTRANSLATORS_H__
66 
void AssertionErrorTranslator(const EsysException &e)
Function which translates an EsysException into a python AssertionError.
Definition: ExceptionTranslators.cpp:21
Definition: AbstractContinuousDomain.cpp:22
void IOErrorTranslator(const EsysException &e)
Function which translates an EsysException into a python IOError.
Definition: ExceptionTranslators.cpp:26
void RuntimeErrorTranslator(const EsysException &e)
Function which translates an EsysException into a python RuntimeError.
Definition: ExceptionTranslators.cpp:36
void ValueErrorTranslator(const EsysException &e)
Function which translates an EsysException into a python ValueError.
Definition: ExceptionTranslators.cpp:41
void NotImplementedErrorTranslator(const EsysException &e)
Function which translates an EsysException into a python NotImplementedError.
Definition: ExceptionTranslators.cpp:31