Friendly exception message when datatype with name more than 255 characters is saved

This commit is contained in:
Poornima Nayar
2019-08-29 17:04:42 +01:00
committed by Sebastiaan Janssen
parent 088abae314
commit 79f8dc200a

View File

@@ -349,6 +349,11 @@ namespace Umbraco.Core.Services.Implement
throw new ArgumentException("Cannot save datatype with empty name.");
}
if (dataType.Name != null && dataType.Name.Length > 255)
{
throw new InvalidOperationException("Name cannot be more than 255 characters in length.");
}
_dataTypeRepository.Save(dataType);
saveEventArgs.CanCancel = false;