HDFS-15927. Catch polymorphic type by reference (#2824)
This commit is contained in:
parent
50b1e1c0c4
commit
8668abf87e
|
@ -135,7 +135,7 @@ std::vector<NamenodeInfo> HdfsConfiguration::LookupNameService(const std::string
|
||||||
URI uri;
|
URI uri;
|
||||||
try {
|
try {
|
||||||
uri = URI::parse_from_string(PrependHdfsScheme(Get(dom_node_name)));
|
uri = URI::parse_from_string(PrependHdfsScheme(Get(dom_node_name)));
|
||||||
} catch (const uri_parse_error) {
|
} catch (const uri_parse_error&) {
|
||||||
throw ha_parse_error("unable to find " + dom_node_name);
|
throw ha_parse_error("unable to find " + dom_node_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,7 +148,7 @@ std::vector<NamenodeInfo> HdfsConfiguration::LookupNameService(const std::string
|
||||||
NamenodeInfo node(nameservice, *node_id, uri);
|
NamenodeInfo node(nameservice, *node_id, uri);
|
||||||
namenodes.push_back(node);
|
namenodes.push_back(node);
|
||||||
}
|
}
|
||||||
} catch (ha_parse_error e) {
|
} catch (const ha_parse_error& e) {
|
||||||
LOG_ERROR(kRPC, << "HA cluster detected but failed because : " << e.what());
|
LOG_ERROR(kRPC, << "HA cluster detected but failed because : " << e.what());
|
||||||
namenodes.clear(); // Don't return inconsistent view
|
namenodes.clear(); // Don't return inconsistent view
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue