Fix warning: catching polymorphic type ‘class std::runtime_error’ by value
../contrib/thrift/lib/cpp/src/thrift/protocol/TJSONProtocol.cpp:902:35: warning: catching polymorphic type ‘class std::runtime_error’ by value [-Wcatch-value=]
} catch (std::runtime_error e) {
^
../contrib/thrift/lib/cpp/src/thrift/protocol/TJSONProtocol.cpp:915:33: warning: catching polymorphic type ‘class std::runtime_error’ by value [-Wcatch-value=]
} catch (std::runtime_error e) {
^
diff --git a/lib/cpp/src/thrift/protocol/TJSONProtocol.cpp b/lib/cpp/src/thrift/protocol/TJSONProtocol.cpp
index a49a148..80def7f 100644
--- a/lib/cpp/src/thrift/protocol/TJSONProtocol.cpp
+++ b/lib/cpp/src/thrift/protocol/TJSONProtocol.cpp
@@ -899,7 +899,7 @@
}
try {
num = fromString<double>(str);
- } catch (std::runtime_error e) {
+ } catch (std::runtime_error& e) {
throw TProtocolException(TProtocolException::INVALID_DATA,
"Expected numeric value; got \"" + str + "\"");
}
@@ -912,7 +912,7 @@
result += readJSONNumericChars(str);
try {
num = fromString<double>(str);
- } catch (std::runtime_error e) {
+ } catch (std::runtime_error& e) {
throw TProtocolException(TProtocolException::INVALID_DATA,
"Expected numeric value; got \"" + str + "\"");
}