18 #ifndef INCLUDE_RCF_EXCEPTION_HPP 19 #define INCLUDE_RCF_EXCEPTION_HPP 27 #include <RCF/Export.hpp> 28 #include <RCF/Config.hpp> 30 #include <RCF/ErrorMsg.hpp> 31 #include <RCF/MemStream.hpp> 39 RCF_EXPORT std::string osError(
int err);
43 #pragma warning(disable:4100) 44 #pragma warning(disable:4267) 48 std::string convertToString(
const std::u8string& t);
52 std::string convertToString(T t)
63 RCF_EXPORT
bool shouldDisconnectOnRemoteError(
int errorId);
64 RCF_EXPORT
int getRuntimeVersionOfThisRemoteCall();
76 const std::string & arg1 =
"",
77 const std::string & arg2 =
"",
78 const std::string & arg3 =
"");
85 init(msg, convertToString(arg1),
"",
"");
88 template<
typename T1,
typename T2>
94 init(msg, convertToString(arg1), convertToString(arg2),
"");
97 template<
typename T1,
typename T2,
typename T3>
104 init(msg, convertToString(arg1), convertToString(arg2), convertToString(arg3));
107 template<
typename T1,
typename T2,
typename T3,
typename T4>
115 init(msg, convertToString(arg1), convertToString(arg2), convertToString(arg3), convertToString(arg4));
120 const std::string & arg1 =
"",
121 const std::string & arg2 =
"",
122 const std::string & arg3 =
"",
123 const std::string & arg4 =
"");
129 virtual std::unique_ptr<Exception> clone()
const;
141 const char * what()
const throw();
144 int getErrorId()
const;
147 std::string getErrorMessage()
const;
149 bool getShouldRetry()
const;
150 void setShouldRetry(
bool shouldRetry);
152 virtual void throwSelf()
const;
155 std::string getErrorString()
const;
161 std::string mErrorString;
162 bool mShouldRetry =
false;
165 typedef std::shared_ptr<Exception> ExceptionPtr;
178 const std::string & arg1 =
"",
179 const std::string & arg2 =
"",
180 const std::string & arg3 =
"");
184 #if RCF_FEATURE_SF==1 190 #if RCF_FEATURE_BOOST_SERIALIZATION==1 191 template<
typename Archive>
192 void serialize(Archive &ar,
const unsigned int)
200 std::unique_ptr<Exception> clone()
const;
202 void throwSelf()
const;
205 std::string mRemoteExceptionType;
213 std::uint32_t runtimeVersion,
214 std::uint32_t archiveVersion);
224 std::unique_ptr<Exception> clone()
const;
225 void throwSelf()
const;
228 std::uint32_t mRuntimeVersion;
229 std::uint32_t mArchiveVersion;
234 #endif // ! INCLUDE_RCF_EXCEPTION_HPP Represents an archive, in which serialized objects are stored.
Definition: Archive.hpp:31
RCF_EXPORT std::uint32_t getArchiveVersion()
Gets the RCF archive version number.
Base class for all RCF exceptions.
Definition: Exception.hpp:67
Definition: ByteBuffer.hpp:188
RCF_EXPORT std::uint32_t getRuntimeVersion()
Gets the RCF runtime version number.
Represents an error that occurs on a RCF server and is transmitted back to the client.
Definition: Exception.hpp:168
Represents a versioning error raised by a server. Allows the server to specify runtime and archive ve...
Definition: Exception.hpp:209
Definition: AmiIoHandler.hpp:23
RCF_EXPORT bool init(RcfConfigT *=nullptr)
Reference-counted initialization of RCF library. May be called multiple times (see deinit())...