[blam] ItemStore: Fail gracefully if the DB file isn't found
- From: Carlos Martín Nieto <cmartin src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [blam] ItemStore: Fail gracefully if the DB file isn't found
- Date: Sat, 26 Mar 2011 11:34:45 +0000 (UTC)
commit 0947e274614258ed0a666bece046abaafd8d4c02
Author: Carlos MartÃn Nieto <carlos cmartin tk>
Date: Sat Mar 26 12:26:01 2011 +0100
ItemStore: Fail gracefully if the DB file isn't found
Return immediately if the backing file isn't found instead of creating
and empty one and have the parser throw an exception which causes
higher levels to use the default channels.
Signed-off-by: Carlos MartÃn Nieto <carlos cmartin tk>
src/ItemStore.cs | 9 ++-------
1 files changed, 2 insertions(+), 7 deletions(-)
---
diff --git a/src/ItemStore.cs b/src/ItemStore.cs
index 2b4060a..625d405 100644
--- a/src/ItemStore.cs
+++ b/src/ItemStore.cs
@@ -67,13 +67,8 @@ namespace Imendio.Blam
XmlReader reader;
try{
reader = new XmlTextReader(itemfile);
- } catch(FileNotFoundException e){
- File.Create(itemfile);
- reader = new XmlTextReader(itemfile);
- }
- catch(Exception e){
- Console.WriteLine(e.Message);
- Console.WriteLine("item file not found");
+ } catch(Exception e){
+ Console.WriteLine("Can't open item db: {0}", e.Message);
return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]