autorun: use GError.matches() to fix some FIXMEs

Discard FAILED_HANDLED errors, now that we can detect them from JS.

https://bugzilla.gnome.org/show_bug.cgi?id=674962
This commit is contained in:
Cosimo Cecchi 2012-06-20 16:35:29 -04:00
parent 66af7de6d6
commit f7c0f826d4
2 changed files with 12 additions and 16 deletions

View File

@ -268,7 +268,9 @@ const AutomountManager = new Lang.Class({
if (e.message.indexOf('No key available with this passphrase') != -1) { if (e.message.indexOf('No key available with this passphrase') != -1) {
this._reaskPassword(volume); this._reaskPassword(volume);
} else { } else {
if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.FAILED_HANDLED))
log('Unable to mount volume ' + volume.get_name() + ': ' + e.toString()); log('Unable to mount volume ' + volume.get_name() + ': ' + e.toString());
this._closeOperation(volume); this._closeOperation(volume);
} }
} }

View File

@ -226,9 +226,7 @@ const AutorunManager = new Lang.Class({
try { try {
mount.unmount_with_operation_finish(res); mount.unmount_with_operation_finish(res);
} catch (e) { } catch (e) {
// FIXME: we need to ignore G_IO_ERROR_FAILED_HANDLED errors here if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.FAILED_HANDLED))
// but we can't access the error code from JS.
// See https://bugzilla.gnome.org/show_bug.cgi?id=591480
log('Unable to eject the mount ' + mount.get_name() log('Unable to eject the mount ' + mount.get_name()
+ ': ' + e.toString()); + ': ' + e.toString());
} }
@ -238,9 +236,7 @@ const AutorunManager = new Lang.Class({
try { try {
source.eject_with_operation_finish(res); source.eject_with_operation_finish(res);
} catch (e) { } catch (e) {
// FIXME: we need to ignore G_IO_ERROR_FAILED_HANDLED errors here if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.FAILED_HANDLED))
// but we can't access the error code from JS.
// See https://bugzilla.gnome.org/show_bug.cgi?id=591480
log('Unable to eject the drive ' + source.get_name() log('Unable to eject the drive ' + source.get_name()
+ ': ' + e.toString()); + ': ' + e.toString());
} }
@ -250,9 +246,7 @@ const AutorunManager = new Lang.Class({
try { try {
drive.stop_finish(res); drive.stop_finish(res);
} catch (e) { } catch (e) {
// FIXME: we need to ignore G_IO_ERROR_FAILED_HANDLED errors here if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.FAILED_HANDLED))
// but we can't access the error code from JS.
// See https://bugzilla.gnome.org/show_bug.cgi?id=591480
log('Unable to stop the drive ' + drive.get_name() log('Unable to stop the drive ' + drive.get_name()
+ ': ' + e.toString()); + ': ' + e.toString());
} }