Better exception message on media type save

(cherry picked from commit d2efcc822d)
This commit is contained in:
Poornima Nayar
2019-08-29 17:22:23 +01:00
committed by Sebastiaan Janssen
parent 2024681a26
commit cafd07fd01

View File

@@ -390,6 +390,11 @@ namespace Umbraco.Core.Services.Implement
if (string.IsNullOrWhiteSpace(item.Name))
throw new ArgumentException("Cannot save item with empty name.");
if (item.Name != null && item.Name.Length > 255)
{
throw new InvalidOperationException("Name cannot be more than 255 characters in length.");
}
scope.WriteLock(WriteLockIds);
// validate the DAG transform, within the lock