[libhttpseverywhere] updater: throw correct error
- From: Daniel Brendle <elbren src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libhttpseverywhere] updater: throw correct error
- Date: Tue, 1 Nov 2016 21:09:56 +0000 (UTC)
commit 2c2e11dec5dbe52b43f20eaea37549575c48a2a3
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 7acd1f7..6f6a441 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]