Generalized exception handling during server response parsing to catch all possible exceptions

This commit is contained in:
Александр Зацепин 2018-11-23 15:56:56 +03:00 committed by Roman Kuznetsov
parent 032601d317
commit 28104b6dc5

View file

@ -250,8 +250,10 @@ void Purchase::ValidateImpl(std::string const & url, ValidationInfo const & vali
coding::DeserializerJson deserializer(request.ServerResponse());
deserializer(result);
}
catch(coding::DeserializerJson::Exception const &) {}
catch(std::exception const & e)
{
LOG(LWARNING, ("Bad server response. Code =", resultCode, ". Reason =", e.what()));
}
if (!result.m_reason.empty())
LOG(LWARNING, ("Validation error:", result.m_reason));
}