Friendly exception message when datatype with name more than 255 characters is saved
This commit is contained in:
committed by
Sebastiaan Janssen
parent
088abae314
commit
79f8dc200a
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user