From 955ce1dd2d9970d1c1e246d2d4e4fb8b07fe6c19 Mon Sep 17 00:00:00 2001 From: bao-qian Date: Sat, 20 Aug 2016 01:02:20 +0100 Subject: [PATCH] Ignore broken cache #783 --- Wox.Infrastructure/Storage/BinaryStorage.cs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Wox.Infrastructure/Storage/BinaryStorage.cs b/Wox.Infrastructure/Storage/BinaryStorage.cs index 2de0006114..f18df92c5b 100644 --- a/Wox.Infrastructure/Storage/BinaryStorage.cs +++ b/Wox.Infrastructure/Storage/BinaryStorage.cs @@ -60,16 +60,11 @@ namespace Wox.Infrastructure.Storage try { - Data = (T)binaryFormatter.Deserialize(stream); + Data = (T) binaryFormatter.Deserialize(stream); } - catch (SerializationException e) - { - Log.Exception(e); - stream.Close(); - LoadDefault(); - } - catch (InvalidCastException e) + catch (System.Exception e) { + Log.Error($"Broken cache file: {FilePath}"); Log.Exception(e); stream.Close(); LoadDefault();