From 650663de0ca37dfad7baa22d3c6c2d9e18e9e8cb Mon Sep 17 00:00:00 2001 From: jmayntzhusen <36075913+jmayntzhusen@users.noreply.github.com> Date: Thu, 29 Aug 2019 14:01:30 +0200 Subject: [PATCH] Improve error messages (#6154) (cherry picked from commit 4dad427a643885a138b16c708fb1bba16085f90e) --- src/Umbraco.Core/Services/Implement/ContentService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Core/Services/Implement/ContentService.cs b/src/Umbraco.Core/Services/Implement/ContentService.cs index 5492f97409..faf4744c76 100644 --- a/src/Umbraco.Core/Services/Implement/ContentService.cs +++ b/src/Umbraco.Core/Services/Implement/ContentService.cs @@ -757,11 +757,11 @@ namespace Umbraco.Core.Services.Implement { var publishedState = content.PublishedState; if (publishedState != PublishedState.Published && publishedState != PublishedState.Unpublished) - throw new InvalidOperationException("Cannot save (un)publishing content, use the dedicated SavePublished method."); + throw new InvalidOperationException($"Cannot save (un)publishing content with name: {content.Name} - and state: {content.PublishedState}, use the dedicated SavePublished method."); if (content.Name != null && content.Name.Length > 255) { - throw new InvalidOperationException("Name cannot be more than 255 characters in length."); + throw new InvalidOperationException($"Content with the name {content.Name} cannot be more than 255 characters in length."); } var evtMsgs = EventMessagesFactory.Get();