OnixS C++ FIX Engine  4.8.0
API Documentation
Exception.h
Go to the documentation of this file.
1 #pragma once
2 /*
3 * Copyright Onix Solutions Limited [OnixS]. All rights reserved.
4 *
5 * This software owned by Onix Solutions Limited [OnixS] and is protected by copyright law
6 * and international copyright treaties.
7 *
8 * Access to and use of the software is governed by the terms of the applicable OnixS Software
9 * Services Agreement (the Agreement) and Customer end user license agreements granting
10 * a non-assignable, non-transferable and non-exclusive license to use the software
11 * for it's own data processing purposes under the terms defined in the Agreement.
12 *
13 * Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part
14 * of this source code or associated reference material to any other location for further reproduction
15 * or redistribution, and any amendments to this copyright notice, are expressly prohibited.
16 *
17 * Any reproduction or redistribution for sale or hiring of the Software not in accordance with
18 * the terms of the Agreement is a violation of copyright law.
19 */
20 
21 #include <exception>
22 
23 #include <OnixS/FIXEngine/ABI.h>
27 
28 namespace OnixS {
29 namespace FIX {
30 /// Engine-level exception.
31 typedef std::exception Exception;
32 
33 /// Engine-level runtime error;
34 typedef std::runtime_error RuntimeError;
35 
36 /// First received message is not a Logon (MsgType=A) FIX Message.
38 {
39 public:
40  /// Constructor.
41  FirstMessageNotLogonException(const std::string & message, const Message & incomingMessage)
42  : RuntimeError(message)
43  , incomingMessage_(incomingMessage)
44  {}
45 
46  /// Constructor.
47  FirstMessageNotLogonException(const std::string & message, const FlatMessage & incomingMessage)
48  : RuntimeError(message)
49  , flatIncomingMessage_(incomingMessage)
50  {}
51 
52  /// Destructor.
54 
55  /// Returns the received message.
56  const Message & message() const {
57  return incomingMessage_;
58  }
59 
60  /// Returns the received message.
61  const FlatMessage & flatMessage() const {
62  return flatIncomingMessage_;
63  }
64 
65 private:
66  Message incomingMessage_;
67  FlatMessage flatIncomingMessage_;
68 };
69 
70 /// Telecommunication link error is detected after sending the initial Logon message.
72 {
73 public:
74  /// Constructor.
75  LinkErrorException(const std::string & message)
76  : RuntimeError(message)
77  {}
78 
79  /// Destructor.
81 };
82 
83 /// First received message is a Logon message with wrong sequence number.
85 {
86 public:
87  /// Constructor.
88  UnexpectedSequenceNumberException(const std::string & message)
89  : RuntimeError(message)
90  {}
91 
92  /// Destructor.
94 };
95 
96 /// Timeout is occurred after sending the initial Logon message.
98 {
99 public:
100  /// Constructor.
101  TimeoutException(const std::string & message)
102  : RuntimeError(message)
103  {}
104 
105  /// Destructor.
107 };
108 
109 /// First received message is an invalid Logon message.
111 {
112 public:
113  /// Constructor.
114  ConfirmationLogonMessageErrorException(const std::string & message)
115  : RuntimeError(message)
116  {}
117 
118  /// Destructor.
120 };
121 
122 /// Message validation is failed.
124 {
125 public:
126  /// Constructor.
127  ValidationException(const std::string & message, Tag tag, MessageValidationFlag::Enum failedValidation)
128  : RuntimeError(message), tag_(tag), failedValidation_(failedValidation)
129  {}
130 
131  /// Destructor.
133 
134  /// Returns the tag number of the invalid field.
135  Tag tag() const {
136  return tag_;
137  }
138 
139  /// Returns the validation criteria that fails.
141  return failedValidation_;
142  }
143 
144 private:
145 
146  Tag tag_;
147  MessageValidationFlag::Enum failedValidation_;
148 };
149 }
150 }
Tag tag() const
Returns the tag number of the invalid field.
Definition: Exception.h:135
Timeout is occurred after sending the initial Logon message.
Definition: Exception.h:97
const Message & message() const
Returns the received message.
Definition: Exception.h:56
#define ONIXS_FIXENGINE_NOTHROW
Definition: Compiler.h:43
#define ONIXS_FIXENGINE_DEFAULT
Definition: Compiler.h:176
#define ONIXS_FIXENGINE_THROWABLE_API
Definition: ABI.h:46
Message validation is failed.
Definition: Exception.h:123
std::exception Exception
Engine-level exception.
Definition: Exception.h:31
Provides access to FIX fields from a flat (tag=value) message.
Definition: FlatMessage.h:75
LinkErrorException(const std::string &message)
Constructor.
Definition: Exception.h:75
First received message is not a Logon (MsgType=A) FIX Message.
Definition: Exception.h:37
UnexpectedSequenceNumberException(const std::string &message)
Constructor.
Definition: Exception.h:88
std::runtime_error RuntimeError
Engine-level runtime error;.
Definition: Exception.h:34
First received message is an invalid Logon message.
Definition: Exception.h:110
unsigned Tag
Alias for tag numbers.
Definition: Tag.h:28
const FlatMessage & flatMessage() const
Returns the received message.
Definition: Exception.h:61
TimeoutException(const std::string &message)
Constructor.
Definition: Exception.h:101
ValidationException(const std::string &message, Tag tag, MessageValidationFlag::Enum failedValidation)
Constructor.
Definition: Exception.h:127
ConfirmationLogonMessageErrorException(const std::string &message)
Constructor.
Definition: Exception.h:114
MessageValidationFlag::Enum failedValidation() const
Returns the validation criteria that fails.
Definition: Exception.h:140
Encapsulates operations over a FIX Message.
Definition: Message.h:49
Telecommunication link error is detected after sending the initial Logon message. ...
Definition: Exception.h:71
FirstMessageNotLogonException(const std::string &message, const FlatMessage &incomingMessage)
Constructor.
Definition: Exception.h:47
First received message is a Logon message with wrong sequence number.
Definition: Exception.h:84
FirstMessageNotLogonException(const std::string &message, const Message &incomingMessage)
Constructor.
Definition: Exception.h:41