Ignore broken cache #783

This commit is contained in:
bao-qian 2016-08-20 01:02:20 +01:00
parent f32f37cfbb
commit 955ce1dd2d

View file

@ -60,16 +60,11 @@ namespace Wox.Infrastructure.Storage
try try
{ {
Data = (T)binaryFormatter.Deserialize(stream); Data = (T) binaryFormatter.Deserialize(stream);
} }
catch (SerializationException e) catch (System.Exception e)
{
Log.Exception(e);
stream.Close();
LoadDefault();
}
catch (InvalidCastException e)
{ {
Log.Error($"Broken cache file: {FilePath}");
Log.Exception(e); Log.Exception(e);
stream.Close(); stream.Close();
LoadDefault(); LoadDefault();