[libhttpseverywhere] Fix bogus error message when updates directory already exists



commit cdedbb42ce81071ced28cc76bab81a6c3e6881d9
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Sun Nov 6 13:09:00 2016 -0600

    Fix bogus error message when updates directory already exists
    
    Also, report what actually went wrong when the operation really does
    fail.

 src/update.vala |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/update.vala b/src/update.vala
index 1dfb4f7..769bbf5 100644
--- a/src/update.vala
+++ b/src/update.vala
@@ -219,8 +219,9 @@ namespace HTTPSEverywhere {
             try {
                 var f = File.new_for_path(UPDATE_DIR);
                 f.make_directory_with_parents();
-            } catch {
-                critical("Could not create "+UPDATE_DIR+"\n");
+            } catch (Error e) {
+                if (!(e is IOError.EXISTS))
+                    critical("Could not create %s: %s", UPDATE_DIR, e.message);
             }
 
             lock_update();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]