Skip to content
Snippets Groups Projects
Commit 084d8a3a authored by Amna Snene's avatar Amna Snene
Browse files

tools: dhtnetmgr handle errors when saving identity

Change-Id: Iac3504f46050c2d533fa2837240f53b8c03068e8
parent c5ce2695
Branches
No related tags found
No related merge requests found
......@@ -49,7 +49,13 @@ dht::crypto::Identity generateIdentity(const std::filesystem::path& path_id, con
fmt::print(stderr, "Error: failed to create directory {}\n", path_id.string());
return {};
}
dht::crypto::saveIdentity(identity, path_id / name);
// catch error
try{
dht::crypto::saveIdentity(identity, path_id / name);
} catch (const std::exception& e) {
fmt::print(stderr, "Error: failed to save identity: {}\n", e.what());
return {};
}
return identity;
}
} // namespace dhtnet
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment