Flow123d  jenkins-Flow123d-linux-release-multijob-282
exc_common.hh
Go to the documentation of this file.
1 /*
2  * exc_common.hh
3  *
4  * Created on: Jan 17, 2014
5  * Author: jb
6  */
7 
8 #ifndef EXC_COMMON_HH_
9 #define EXC_COMMON_HH_
10 
11 /**
12  * @file
13  *
14  * Common exceptions.
15  */
16 
17 #include <system/exceptions.hh>
18 
19 /**
20  * Assert exception with an string message.
21  */
22 TYPEDEF_ERR_INFO( EI_Message, std::string);
23 TYPEDEF_ERR_INFO( EI_MPI_Rank, int);
24 DECLARE_EXCEPTION( ExcAssertMsg, << "[" << EI_MPI_Rank::val << "] "
25  << "Violated Assert! " << EI_Message::val);
26 
27 /**
28  * General exception with message.
29  */
30 DECLARE_EXCEPTION( ExcMessage, << EI_Message::val);
31 
32 
33 
34 /**
35  * Test of ierr return codes for MPI and PETSc
36  */
37 TYPEDEF_ERR_INFO( EI_ErrCode, int);
38 DECLARE_EXCEPTION( ExcChkErr, << "[" << EI_ErrCode::val << "] ");
39 DECLARE_EXCEPTION( ExcChkErrAssert, << "[" << EI_ErrCode::val << "] ");
40 
41 
42 
43 
44 
45 
46 #endif /* EXC_COMMON_HH_ */
#define DECLARE_EXCEPTION(ExcName, Format)
Macro for simple definition of exceptions.
Definition: exceptions.hh:135
#define TYPEDEF_ERR_INFO(EI_Type, Type)
Macro to simplify declaration of error_info types.
Definition: exceptions.hh:171