shill: Catch C++ exceptions by reference instead of value.
BUG=chromium-os:30583
TEST=Build and run unit tests.
Change-Id: Icaa836893724a8cf03547da2a575b458b0fd6792
Reviewed-on: https://gerrit.chromium.org/gerrit/21920
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>
diff --git a/mm1_modem_proxy.cc b/mm1_modem_proxy.cc
index f03ae3a..13e7f4c 100644
--- a/mm1_modem_proxy.cc
+++ b/mm1_modem_proxy.cc
@@ -36,7 +36,7 @@
SLOG(DBus, 2) << __func__;
proxy_.Enable(enable, cb.get(), timeout);
cb.release();
- } catch (DBus::Error e) {
+ } catch (const DBus::Error &e) {
if (error)
CellularError::FromDBusError(e, error);
}
@@ -50,7 +50,7 @@
SLOG(DBus, 2) << __func__;
proxy_.ListBearers(cb.get(), timeout);
cb.release();
- } catch (DBus::Error e) {
+ } catch (const DBus::Error &e) {
if (error)
CellularError::FromDBusError(e, error);
}
@@ -66,7 +66,7 @@
SLOG(DBus, 2) << __func__;
proxy_.CreateBearer(properties, cb.get(), timeout);
cb.release();
- } catch (DBus::Error e) {
+ } catch (const DBus::Error &e) {
if (error)
CellularError::FromDBusError(e, error);
}
@@ -81,7 +81,7 @@
SLOG(DBus, 2) << __func__;
proxy_.DeleteBearer(bearer, cb.get(), timeout);
cb.release();
- } catch (DBus::Error e) {
+ } catch (const DBus::Error &e) {
if (error)
CellularError::FromDBusError(e, error);
}
@@ -95,7 +95,7 @@
SLOG(DBus, 2) << __func__;
proxy_.Reset(cb.get(), timeout);
cb.release();
- } catch (DBus::Error e) {
+ } catch (const DBus::Error &e) {
if (error)
CellularError::FromDBusError(e, error);
}
@@ -110,7 +110,7 @@
SLOG(DBus, 2) << __func__;
proxy_.FactoryReset(code, cb.get(), timeout);
cb.release();
- } catch (DBus::Error e) {
+ } catch (const DBus::Error &e) {
if (error)
CellularError::FromDBusError(e, error);
}
@@ -126,7 +126,7 @@
SLOG(DBus, 2) << __func__;
proxy_.SetAllowedModes(modes, preferred, cb.get(), timeout);
cb.release();
- } catch (DBus::Error e) {
+ } catch (const DBus::Error &e) {
if (error)
CellularError::FromDBusError(e, error);
}
@@ -141,7 +141,7 @@
SLOG(DBus, 2) << __func__;
proxy_.SetBands(bands, cb.get(), timeout);
cb.release();
- } catch (DBus::Error e) {
+ } catch (const DBus::Error &e) {
if (error)
CellularError::FromDBusError(e, error);
}
@@ -157,7 +157,7 @@
SLOG(DBus, 2) << __func__;
proxy_.Command(cmd, user_timeout, cb.get(), timeout);
cb.release();
- } catch (DBus::Error e) {
+ } catch (const DBus::Error &e) {
if (error)
CellularError::FromDBusError(e, error);
}