isapego commented on a change in pull request #9773:
URL: https://github.com/apache/ignite/pull/9773#discussion_r793404276
##########
File path: modules/platforms/cpp/common/src/common/utils.cpp
##########
@@ -229,5 +231,46 @@ namespace ignite
return dump.str();
}
+ void ThrowSystemError(const std::string &msg)
+ {
+ throw IgniteError(IgniteError::IGNITE_ERR_GENERIC, msg.c_str());
+ }
+
+ void ThrowLastSystemError(const std::string& description, const
std::string& advice)
+ {
+ ThrowSystemError(GetLastSystemError(description, advice));
+ }
+
+ void ThrowLastSystemError(const std::string& description)
+ {
+ std::string empty;
+ ThrowLastSystemError(description, empty);
+ }
+
+ std::string FormatErrorMessage(const std::string &description, const
std::string &details,
+ const std::string &advice)
+ {
+ std::stringstream messageBuilder;
+ messageBuilder << description;
+ if (!details.empty())
+ messageBuilder << ": " << details;
+
+ if (!advice.empty())
+ messageBuilder << ". " << advice;
+
+ return messageBuilder.str();
+ }
+
+ std::string GetLastSystemError(const std::string& description, const
std::string& advice)
+ {
+ return common::FormatErrorMessage(description,
GetLastSystemError(), advice);
Review comment:
Fixed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]