[libhttpseverywhere: 19/21] updater: lock throws correct exceptions



commit db0a9591dcbbfdae583f03a22b950c08916a4d95
Author: grindhold <grindhold gmx net>
Date:   Sat Nov 19 19:21:44 2016 +0100

    updater: lock throws correct exceptions
    
    the UpdateError.IN_PROGRESS must be rethrown in order to
    get the right exceptions.

 src/update.vala |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/update.vala b/src/update.vala
index 87c4443..705cd93 100644
--- a/src/update.vala
+++ b/src/update.vala
@@ -113,6 +113,9 @@ namespace HTTPSEverywhere {
                     }
                     update_in_progress = true;
                 } catch (Error e ) {
+                    if (e is UpdateError.IN_PROGRESS) {
+                        throw (UpdateError)e;
+                    }
                     throw new UpdateError.WRITE_FAILED("Error querying lock file: %s".printf(e.message));
                 }
             } else {


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