From: Arvin Schnell Date: Mon, 29 Oct 2018 10:08:31 +0000 (+0100) Subject: - improved error handling X-Git-Tag: v0.8.0~7^2~1 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=1b0c3da62ec136fccb3966717a9a172c19d70d17;p=thirdparty%2Fsnapper.git - improved error handling --- diff --git a/client/snapper.cc b/client/snapper.cc index d809677d..46240068 100644 --- a/client/snapper.cc +++ b/client/snapper.cc @@ -445,8 +445,25 @@ list_from_one_config(ProxySnapper* snapper, ListMode list_mode, bool show_used_s { const ProxySnapshots& snapshots = snapper->getSnapshots(); - ProxySnapshots::const_iterator default_snapshot = snapshots.getDefault(); - ProxySnapshots::const_iterator active_snapshot = snapshots.getActive(); + ProxySnapshots::const_iterator default_snapshot = snapshots.end(); + ProxySnapshots::const_iterator active_snapshot = snapshots.end(); + + try + { + default_snapshot = snapshots.getDefault(); + active_snapshot = snapshots.getActive(); + } + catch (const DBus::ErrorException& e) + { + SN_CAUGHT(e); + + // If snapper was just updated and the old snapperd is still + // running it might not know the GetDefaultSnapshot and + // GetActiveSnapshot methods. + + if (strcmp(e.name(), "error.unknown_method") != 0) + SN_RETHROW(e); + } if (list_mode != LM_ALL && list_mode != LM_SINGLE) show_used_space = false;