HDFS-15927. Catch polymorphic type by reference (#2824)

This commit is contained in:
Gautham B A 2021-03-31 02:05:45 +05:30 committed by GitHub
parent 50b1e1c0c4
commit 8668abf87e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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
} }