fintp_routingengine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RoutingExceptions.h
Go to the documentation of this file.
1 /*
2 * FinTP - Financial Transactions Processing Application
3 * Copyright (C) 2013 Business Information Systems (Allevo) S.R.L.
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>
17 * or contact Allevo at : 031281 Bucuresti, 23C Calea Vitan, Romania,
18 * phone +40212554577, office@allevo.ro <mailto:office@allevo.ro>, www.allevo.ro.
19 */
20 
21 #ifndef ROUTINGEXCEPTIONS_H
22 #define ROUTINGEXCEPTIONS_H
23 
24 #include <stdexcept>
25 
26 #include "AppExceptions.h"
27 
28 #include "RoutingEngineMain.h"
29 
30 #define RoutingExceptionLocation "Location not available"
31 //string( "<ExceptionLocation file=\"" ) + __FILE__ + string( "\" line=\" __LINE__ \">")
32 //+ string( __FILE__) + string( """ line=""" ) + string( __LINE__ )+ string( """>") )
33 
34 class RoutingException : public logic_error
35 {
36  private :
37  string m_Location;
38 
39  public:
40 
41  RoutingException( const string& message, const string& location );
42  ~RoutingException() throw() {};
43 
44  static RoutingException EmbedException( const string& message, const string& location, const RoutingException &rex );
45 
46  string getLocation() const { return m_Location; }
47 };
48 
49 class RoutingExceptionMoveInvestig : public AppException
50 {
51  public:
52 
53  RoutingExceptionMoveInvestig( const string& reason = "unknown reason" ) : AppException( "Message moved to investigation", EventType::Warning )
54  {
55  m_Message = string( "Message moved to investigation [" ) + reason + string( "]" );
56  addAdditionalInfo( "Reason", reason );
57  }
59 };
60 
61 class RoutingExceptionMessageNotFound : public AppException
62 {
63  public:
64 
65  RoutingExceptionMessageNotFound( const string& reason = "unknown reason" ) : AppException( "Message not found", EventType::Warning )
66  {
67  m_Message = string( "Message not found [" ) + reason + string( "]" );
68  addAdditionalInfo( "Reason", reason );
69  }
71 };
72 
73 class RoutingExceptionMessageDeleted : public AppException
74 {
75  public:
76 
77  RoutingExceptionMessageDeleted() : AppException( "Message deleted", EventType::Warning )
78  {
79  m_Message = string( "Message deleted" );
80  }
82 };
83 
84 class RoutingExceptionAggregationFailure : public AppException
85 {
86  public:
87 
88  RoutingExceptionAggregationFailure( const string& token, const string& value ) : AppException( "No aggregation records found", EventType::Error )
89  {
90  m_Message = string( "No aggregation records found for [" ) + token + string( " = " ) + value + string( "]" );
91  addAdditionalInfo( "TokenName", token );
92  addAdditionalInfo( "TokenValue", value );
93  }
95 };
96 
97 class RoutingExceptionJobAttemptsExceded : public logic_error
98 {
99  public:
100 
103 };
104 
105 #endif