a slightly better handling of source-delete exceptions
authorMartin Vidner <mvidner@suse.cz>
Wed, 18 Oct 2006 19:39:05 +0000 (19:39 +0000)
committerMartin Vidner <mvidner@suse.cz>
Wed, 18 Oct 2006 19:39:05 +0000 (19:39 +0000)
tools/zmart/zmart-sources.cc
tools/zmart/zypper.cc

index 557afa1..80a25c2 100644 (file)
@@ -282,7 +282,16 @@ void remove_source( const std::string& anystring )
   cerr_vv << "Constructing SourceManager" << endl;
   SourceManager_Ptr manager = SourceManager::sourceManager();
   cerr_vv << "Restoring SourceManager" << endl;
-  manager->restore ("/", true /*use_cache*/);
+  try {
+    manager->restore ("/", true /*use_cache*/);
+    }
+  catch (const Exception & ex) {
+    // so what if sources cannot be restored
+    // we want to delete anyway
+    ZYPP_CAUGHT (ex);
+    cerr << ex.asUserString () << endl
+        << "Continuing anyway" << endl;
+  }
 
   SourceManager::SourceId sid = 0;
   safe_lexical_cast (anystring, sid);
index b743ad5..d56e565 100644 (file)
@@ -514,6 +514,7 @@ int main(int argc, char **argv)
     }
     catch ( const Exception & excpt_r )
     {
+      ZYPP_CAUGHT (excpt_r);
       cerr << excpt_r.asUserString() << endl;
       return 1;
     }