[longomatch] Catch corrupted database exceptions correctly



commit f26263f46cbb21f399368ee96ce2075b00846deb
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Wed Apr 16 17:47:25 2014 +0200

    Catch corrupted database exceptions correctly

 LongoMatch.Services/Services/DataBase.cs |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/LongoMatch.Services/Services/DataBase.cs b/LongoMatch.Services/Services/DataBase.cs
index e071b4e..72c660d 100644
--- a/LongoMatch.Services/Services/DataBase.cs
+++ b/LongoMatch.Services/Services/DataBase.cs
@@ -150,13 +150,13 @@ namespace LongoMatch.DB
                                GetDBVersion();
                                GetBackupDate();
                                CheckDB();
+                               count = GetAllProjects().Count;
                                try {
                                        BackupDB();
                                } catch (Exception e) {
                                        Log.Error("Error creating database backup");
                                        Log.Exception(e);
                                }
-                               count = GetAllProjects().Count;
                        } catch (DatabaseFileLockedException locked) {
                                throw new DBLockedException (locked);
                        } catch (Db4oException ex) {
@@ -193,6 +193,8 @@ namespace LongoMatch.DB
                                                Log.Exception(e);
                                        }
                                }
+                       } catch (Exception ex) {
+                               Log.Exception (ex);
                        }
                        finally
                        {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]