Add logging to ApiClient/ApiController object mapping methods.

This commit is contained in:
lganzzzo 2020-01-25 11:08:37 +07:00
parent cae4fdf2c0
commit 517f75ee3a
2 changed files with 4 additions and 0 deletions

View File

@ -210,6 +210,8 @@ public:
template<typename T>
oatpp::String convertParameterToString(const oatpp::String& typeName, const T& parameter) {
OATPP_LOGE("[oatpp::web::client::ApiClient::convertParameterToString()]",
"Error. No conversion from '%s' to '%s' is defined.", typeName->getData(), "oatpp::String");
throw std::runtime_error("[oatpp::web::client::ApiClient::convertParameterToString()]: Error. "
"No conversion from '" + typeName->std_str() + "' to 'oatpp::String' is defined. "
"Please define type conversion.");

View File

@ -452,6 +452,8 @@ public:
T parseParameterFromString(const oatpp::String& typeName, const oatpp::String& text, bool& success) {
(void) text;
success = false;
OATPP_LOGE("[oatpp::web::server::api::ApiController::parseParameterFromString()]",
"Error. No conversion from '%s' to '%s' is defined.", "oatpp::String", typeName->getData());
throw std::runtime_error("[oatpp::web::server::api::ApiController::parseParameterFromString()]: Error. "
"No conversion from 'oatpp::String' to '" + typeName->std_str() + "' is defined. "
"Please define type conversion.");