From fdfd684e7ad1506ce08baa69673aa00740bfb91e Mon Sep 17 00:00:00 2001 From: bao-qian Date: Sat, 14 Jan 2017 14:21:02 +0000 Subject: [PATCH] remove useless stream.close and more log --- Wox.Infrastructure/Storage/BinaryStorage.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Wox.Infrastructure/Storage/BinaryStorage.cs b/Wox.Infrastructure/Storage/BinaryStorage.cs index cca3d7fe1d..190e8ff7ec 100644 --- a/Wox.Infrastructure/Storage/BinaryStorage.cs +++ b/Wox.Infrastructure/Storage/BinaryStorage.cs @@ -39,7 +39,7 @@ namespace Wox.Infrastructure.Storage } else { - stream.Close(); + Log.Error($"Zero length cache file: {FilePath}"); Save(defaultData); return defaultData; } @@ -47,6 +47,7 @@ namespace Wox.Infrastructure.Storage } else { + Log.Info("Cache file not exist, load default data"); Save(defaultData); return defaultData; } @@ -68,9 +69,8 @@ namespace Wox.Infrastructure.Storage } catch (System.Exception e) { - Log.Error($"Broken cache file: {FilePath}"); + Log.Error($"Deserialize error for cache file: {FilePath}"); Log.Exception(e); - stream.Close(); return defaultData; } finally @@ -110,6 +110,7 @@ namespace Wox.Infrastructure.Storage } catch (SerializationException e) { + Log.Error($"Serialize error for cache file: {FilePath}"); Log.Exception(e); } }