Adds PanicException with details instead of throwing "panic" strings

This commit is contained in:
Shannon
2019-07-30 22:40:15 +10:00
parent ca56655d07
commit 16d8f8846e
14 changed files with 55 additions and 15 deletions

View File

@@ -6,6 +6,7 @@ using System.Threading;
using System.Threading.Tasks;
using CSharpTest.Net.Collections;
using Umbraco.Core;
using Umbraco.Core.Exceptions;
using Umbraco.Core.Logging;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.Scoping;
@@ -1044,7 +1045,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
if (_genObj == null)
_genObjs.Enqueue(_genObj = new GenObj(snapGen));
else if (_genObj.Gen != snapGen)
throw new Exception("panic");
throw new PanicException($"The generation {_genObj.Gen} does not equal the snapshot generation {snapGen}");
}
else
{

View File

@@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Umbraco.Core.Exceptions;
using Umbraco.Core.Scoping;
using Umbraco.Web.PublishedCache.NuCache.Snap;
@@ -371,7 +372,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
// if we have one already, ensure it's consistent
else if (_genObj.Gen != snapGen)
throw new Exception("panic");
throw new PanicException($"The generation {_genObj.Gen} does not equal the snapshot generation {snapGen}");
}
else
{