From 3b22c0cdd7774e6a6d99098b55ca49330a3dde56 Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 23 Mar 2017 11:06:06 +1100 Subject: [PATCH] Catches correct expected exception type, we'll log for other non expected errors. --- .../umbraco/preview/PreviewContent.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/preview/PreviewContent.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/preview/PreviewContent.cs index 44faec0868..9ba5f91bd3 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/preview/PreviewContent.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/preview/PreviewContent.cs @@ -202,13 +202,15 @@ namespace umbraco.presentation.preview { file.Delete(); } - catch (Exception ex) + catch (IOException) { // for *some* reason deleting the file can fail, // and it will work later on (long-lasting locks, etc), // so just ignore the exception - - //LogHelper.Error(string.Format("Couldn't delete preview set: {0} - User {1}", file.Name, userId), ex); + } + catch (Exception ex) + { + LogHelper.Error(string.Format("Couldn't delete preview set: {0} - User {1}", file.Name, userId), ex); } }