[gnome-boxes] Throw error from correct place
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes] Throw error from correct place
- Date: Fri, 25 Nov 2011 23:04:02 +0000 (UTC)
commit 76c4627df4dd3055c91bd8c6a18d60aa13111558
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Thu Nov 24 05:42:49 2011 +0200
Throw error from correct place
https://bugzilla.gnome.org/show_bug.cgi?id=664766
src/installer-media.vala | 2 --
src/os-database.vala | 8 ++++++--
2 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/installer-media.vala b/src/installer-media.vala
index 055c74e..5221485 100644
--- a/src/installer-media.vala
+++ b/src/installer-media.vala
@@ -100,8 +100,6 @@ private class Boxes.InstallerMedia : Object {
var os_id = device.get_property ("OSINFO_INSTALLER");
if (os_id != null) {
os = os_db.get_os_by_id (os_id);
- if (os == null)
- throw new OSDatabaseError.UNKNOWN_OS_ID ("Unknown OS ID '%s'", os_id);
}
}
}
diff --git a/src/os-database.vala b/src/os-database.vala
index b788d06..91b881b 100644
--- a/src/os-database.vala
+++ b/src/os-database.vala
@@ -41,8 +41,12 @@ private class Boxes.OSDatabase {
return db.guess_os_from_media (media, out os_media);
}
- public Os? get_os_by_id (string id) {
- return db.get_os (id);
+ public Os get_os_by_id (string id) throws OSDatabaseError {
+ var os = db.get_os (id);
+ if (os == null)
+ throw new OSDatabaseError.UNKNOWN_OS_ID ("Unknown OS ID '%s'", id);
+
+ return os;
}
public Resources get_resources_for_os (Os? os) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]