[gnome-builder] rustup: be careful about accessing GLib.Error params
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] rustup: be careful about accessing GLib.Error params
- Date: Sun, 19 Mar 2017 23:34:18 +0000 (UTC)
commit 26a3c3a9a26d9ee47745d702de1c92046c06d390
Author: Christian Hergert <chergert redhat com>
Date: Sun Mar 19 16:33:45 2017 -0700
rustup: be careful about accessing GLib.Error params
In case we get a regular exception without a .code attribute. Also use
the IOErrorEnum for the cancelled constant.
plugins/rustup/rustup_plugin/__init__.py | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/plugins/rustup/rustup_plugin/__init__.py b/plugins/rustup/rustup_plugin/__init__.py
index c20ea91..9ca26cb 100644
--- a/plugins/rustup/rustup_plugin/__init__.py
+++ b/plugins/rustup/rustup_plugin/__init__.py
@@ -423,11 +423,10 @@ class RustupInstaller(Ide.Transfer):
task.return_boolean(False)
except Exception as ex:
- # cancelled error
- if ex.code is 19:
+ if getattr(ex, 'code') == Gio.IOErrorEnum.CANCELLED:
self.props.status = _('Cancelled')
else:
- print('_wait_cb', ex, ex.code)
+ print('_wait_cb', repr(ex))
task.return_boolean(False)
RustupApplicationAddin.instance.check_rustup()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]