Permalink
Browse files

Better error handling

  • Loading branch information...
1 parent bc3d6d4 commit bb3eb78d14f05fdb952e91a4ad82261ae3867a22 @ayende ayende committed Jul 10, 2011
Showing with 16 additions and 2 deletions.
  1. +16 −2 Raven.Database/Indexing/Index.cs
@@ -117,9 +117,23 @@ public void Dispose()
{
IndexWriter writer = indexWriter;
indexWriter = null;
- writer.Close();
+ try
+ {
+ writer.Close();
+ }
+ catch (Exception e)
+ {
+ logIndexing.ErrorException("Error when closing the index", e);
+ }
+ }
+ try
+ {
+ directory.Close();
+ }
+ catch (Exception e)
+ {
+ logIndexing.ErrorException("Error when closing the directory", e);
}
- directory.Close();
}
}

0 comments on commit bb3eb78

Please sign in to comment.