OnixS C++ FIX Engine 4.14.0
Users' manual and API documentation
Loading...
Searching...
No Matches
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
28namespace OnixS {
29namespace FIX {
31typedef std::exception Exception;
32
34typedef std::runtime_error RuntimeError;
35
38{
39public:
41 FirstMessageNotLogonException(const std::string & message, const Message & incomingMessage)
43 , incomingMessage_(incomingMessage)
44 {}
45
47 FirstMessageNotLogonException(const std::string & message, const FlatMessage & incomingMessage)
49 , flatIncomingMessage_(incomingMessage)
50 {}
51
53 ~FirstMessageNotLogonException() noexcept override = default;
54
56 const Message & message() const {
57 return incomingMessage_;
58 }
59
61 const FlatMessage & flatMessage() const {
62 return flatIncomingMessage_;
63 }
64
65private:
66 Message incomingMessage_;
67 FlatMessage flatIncomingMessage_;
68};
69
72{
73public:
75 LinkErrorException(const std::string & message)
76 : RuntimeError(message)
77 {}
78
80 ~LinkErrorException() noexcept override = default;
81};
82
85{
86public:
88 UnexpectedSequenceNumberException(const std::string & message)
89 : RuntimeError(message)
90 {}
91
93 ~UnexpectedSequenceNumberException() noexcept override = default;
94};
95
98{
99public:
101 TimeoutException(const std::string & message)
102 : RuntimeError(message)
103 {}
104
106 ~TimeoutException() noexcept override = default;
107};
108
111{
112public:
114 ConfirmationLogonMessageErrorException(const std::string & message)
115 : RuntimeError(message)
116 {}
117
119 ~ConfirmationLogonMessageErrorException() noexcept override = default;
120};
121
124{
125public:
128 : RuntimeError(message), tag_(tag), failedValidation_(failedValidation)
129 {}
130
132 ~ValidationException() noexcept override = default;
133
135 Tag tag() const {
136 return tag_;
137 }
138
141 return failedValidation_;
142 }
143
144private:
145
146 Tag tag_;
147 MessageValidationFlag::Enum failedValidation_;
148};
149
152{
153public:
155 ConnectException(const std::string & message, int errCode = 0)
156 :RuntimeError(message), errCode_(errCode)
157 {}
158
160 ~ConnectException() noexcept override = default;
161
163 int errorCode() const {
164 return errCode_;
165 }
166
167private:
168
169 int errCode_;
170};
171
172}
173}
#define ONIXS_FIXENGINE_THROWABLE_API
Definition ABI.h:46
~ConfirmationLogonMessageErrorException() noexcept override=default
The destructor.
ConfirmationLogonMessageErrorException(const std::string &message)
The constructor.
Definition Exception.h:114
int errorCode() const
Return the system-depended error code value.
Definition Exception.h:163
ConnectException(const std::string &message, int errCode=0)
The constructor.
Definition Exception.h:155
~ConnectException() noexcept override=default
The destructor.
FirstMessageNotLogonException(const std::string &message, const FlatMessage &incomingMessage)
The constructor.
Definition Exception.h:47
~FirstMessageNotLogonException() noexcept override=default
The destructor.
FirstMessageNotLogonException(const std::string &message, const Message &incomingMessage)
The constructor.
Definition Exception.h:41
const FlatMessage & flatMessage() const
Returns the received message.
Definition Exception.h:61
const Message & message() const
Returns the received message.
Definition Exception.h:56
~LinkErrorException() noexcept override=default
The destructor.
LinkErrorException(const std::string &message)
The constructor.
Definition Exception.h:75
TimeoutException(const std::string &message)
The constructor.
Definition Exception.h:101
~TimeoutException() noexcept override=default
The destructor.
UnexpectedSequenceNumberException(const std::string &message)
The constructor.
Definition Exception.h:88
~UnexpectedSequenceNumberException() noexcept override=default
The destructor.
Tag tag() const
Returns the tag number of the invalid field.
Definition Exception.h:135
~ValidationException() noexcept override=default
The destructor.
MessageValidationFlag::Enum failedValidation() const
Returns the validation criteria that fails.
Definition Exception.h:140
ValidationException(const std::string &message, Tag tag, MessageValidationFlag::Enum failedValidation)
The constructor.
Definition Exception.h:127
std::runtime_error RuntimeError
The Engine-level runtime error;.
Definition Exception.h:34
std::exception Exception
The Engine-level exception.
Definition Exception.h:31
unsigned Tag
Alias for tag numbers.
Definition Tag.h:28