diff --git a/src/Umbraco.Web/PublishedCache/NuCache/ContentStore.cs b/src/Umbraco.Web/PublishedCache/NuCache/ContentStore.cs index dbe354d95b..86fc69c302 100644 --- a/src/Umbraco.Web/PublishedCache/NuCache/ContentStore.cs +++ b/src/Umbraco.Web/PublishedCache/NuCache/ContentStore.cs @@ -796,7 +796,7 @@ namespace Umbraco.Web.PublishedCache.NuCache if (_contentNodes.TryGetValue(id, out var link) && link.Value != null) return link; - throw new PanicException($"panic: failed to get {description} with id={id}"); + throw new PanicException($"failed to get {description} with id={id}"); } private LinkedNode GetParentLink(ContentNode content) @@ -827,7 +827,7 @@ namespace Umbraco.Web.PublishedCache.NuCache // must have children if (parent.FirstChildContentId < 0) - throw new Exception("panic: no children"); + throw new PanicException("no children"); // if first, clone parent + remove first child if (parent.FirstChildContentId == content.Id) diff --git a/src/Umbraco.Web/PublishedCache/NuCache/PublishedContent.cs b/src/Umbraco.Web/PublishedCache/NuCache/PublishedContent.cs index cb7acdc164..8fc2dc1006 100644 --- a/src/Umbraco.Web/PublishedCache/NuCache/PublishedContent.cs +++ b/src/Umbraco.Web/PublishedCache/NuCache/PublishedContent.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using Umbraco.Core; using Umbraco.Core.Cache; +using Umbraco.Core.Exceptions; using Umbraco.Core.Models.PublishedContent; using Umbraco.Web.Composing; using Umbraco.Web.Models; @@ -119,7 +120,7 @@ namespace Umbraco.Web.PublishedCache.NuCache case PublishedItemType.Media: return GetMediaByIdFunc; default: - throw new Exception("panic: invalid item type"); + throw new PanicException("invalid item type"); } } @@ -194,7 +195,7 @@ namespace Umbraco.Web.PublishedCache.NuCache }; if (ContentData.CultureInfos == null) - throw new Exception("panic: _contentDate.CultureInfos is null."); + throw new PanicException("_contentDate.CultureInfos is null."); return _cultures = ContentData.CultureInfos .ToDictionary(x => x.Key, x => new PublishedCultureInfo(x.Key, x.Value.Name, x.Value.UrlSegment, x.Value.Date), StringComparer.OrdinalIgnoreCase); @@ -286,13 +287,13 @@ namespace Umbraco.Web.PublishedCache.NuCache { // but if IsPreviewing is true, we should have a child if (IsPreviewing) - throw new Exception($"panic: failed to get content with id={id}"); + throw new PanicException($"failed to get content with id={id}"); // if IsPreviewing is false, get the unpublished child nevertheless // we need it to keep enumerating children! but we don't return it content = getById(publishedSnapshot, true, id); if (content == null) - throw new Exception($"panic: failed to get content with id={id}"); + throw new PanicException($"failed to get content with id={id}"); } id = UnwrapIPublishedContent(content)._contentNode.NextSiblingContentId; diff --git a/src/Umbraco.Web/UmbracoInjectedModule.cs b/src/Umbraco.Web/UmbracoInjectedModule.cs index c973fafa81..db5372efa2 100644 --- a/src/Umbraco.Web/UmbracoInjectedModule.cs +++ b/src/Umbraco.Web/UmbracoInjectedModule.cs @@ -264,7 +264,7 @@ namespace Umbraco.Web case RuntimeLevel.Unknown: case RuntimeLevel.Boot: case RuntimeLevel.BootFailed: - throw new Exception($"panic: Unexpected runtime level: {level}."); + throw new PanicException($"Unexpected runtime level: {level}."); case RuntimeLevel.Run: // ok