[libhttpseverywhere: 13/21] updater: throw correct error



commit 4c252d0304aecc63c79676a8d249fcf3ed8a6031
Author: grindhold <grindhold gmx net>
Date:   Mon Oct 31 20:28:07 2016 +0100

    updater: throw correct error
    
    glib throws an IOError.EXISTS if the lockfile already exists, not
    an FileError.EXIST as previously expected. Now we are checking for
    both errors, just in case.

 src/update.vala |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/update.vala b/src/update.vala
index b071860..eae0a10 100644
--- a/src/update.vala
+++ b/src/update.vala
@@ -95,7 +95,7 @@ namespace HTTPSEverywhere {
                 file.create(FileCreateFlags.NONE);
                 update_in_progress = true;
             } catch (Error e) {
-                if (e is FileError.EXIST)
+                if (e is IOError.EXISTS || e is FileError.EXIST)
                     throw new UpdateError.IN_PROGRESS("Update is already in progress");
                 throw new UpdateError.WRITE_FAILED("Error creating lock file: %s".printf(e.message));
             }


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