Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exception: make Ipv6Instance and Ipv4Instance not throw and remove some try catch pattern #16122

Merged
merged 35 commits into from
Jun 23, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
clean up template in .cc
Signed-off-by: chaoqin-li1123 <chaoqinli@google.com>
  • Loading branch information
chaoqin-li1123 committed May 12, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 9bfc32e0cf7fe509f98aa8f0e40deedfd07b71db
30 changes: 0 additions & 30 deletions source/common/network/address_impl.cc
Original file line number Diff line number Diff line change
@@ -20,36 +20,6 @@ namespace Address {

namespace {

class InstanceFactory {
template <typename InstanceType, typename... Args>
StatusOr<InstanceType> createInstance(Args&&... args) {
absl::Status status;
status = InstanceType::validateProtocolSupported();
if (!status.ok()) {
return status;
}
InstanceType instance(status, std::forward<Args>(args)...);
if (!status.ok()) {
return status;
}
return instance;
}

template <typename InstanceType, typename... Args>
StatusOr<InstanceConstSharedPtr> createInstancePtr(Args&&... args) {
absl::Status status;
status = InstanceType::validateProtocolSupported();
if (!status.ok()) {
return status;
}
std::shared_ptr<InstanceType> instance{new InstanceType(status, std::forward<Args>(args)...)};
if (!status.ok()) {
return status;
}
return instance;
}
};

// Constructs a readable string with the embedded nulls in the abstract path replaced with '@'.
std::string friendlyNameFromAbstractPath(absl::string_view path) {
std::string friendly_name(path.data(), path.size());