catch(std::runtime_error) because missing file is not an error here...

JSON-102
Roker 5 years ago
parent f539517cdb
commit dff4c41b64

@ -83,7 +83,7 @@ ServerVersion::ServerVersion(unsigned maj, unsigned min, unsigned p)
, package_version{PackageVersion}
{
if (!PackageVersion)
{
try{
const std::string pkg_version_from_file =
boost::algorithm::trim_copy(
pEp::utility::slurp("PackageVersion")
@ -91,6 +91,10 @@ ServerVersion::ServerVersion(unsigned maj, unsigned min, unsigned p)
PackageVersion = strdup(pkg_version_from_file.c_str());
this->package_version = PackageVersion;
}
catch(std::runtime_error&)
{
// slurp() throws when it cannot read the file.
}
}
const ServerVersion& server_version()

Loading…
Cancel
Save