Adds in Error without ex for just a message and a message template with params
This commit is contained in:
@@ -227,9 +227,9 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(entity.Alias))
|
||||
{
|
||||
var e = new Exception($"ContentType '{entity.Name}' cannot have an empty Alias. This is most likely due to invalid characters stripped from the Alias.");
|
||||
Logger.Error<ContentTypeRepository>(e, "ContentType '{EntityName}' cannot have an empty Alias. This is most likely due to invalid characters stripped from the Alias.", entity.Name);
|
||||
throw e;
|
||||
var ex = new Exception($"ContentType '{entity.Name}' cannot have an empty Alias. This is most likely due to invalid characters stripped from the Alias.");
|
||||
Logger.Error<ContentTypeRepository>("ContentType '{EntityName}' cannot have an empty Alias. This is most likely due to invalid characters stripped from the Alias.", entity.Name);
|
||||
throw ex;
|
||||
}
|
||||
|
||||
((ContentType)entity).AddingEntity();
|
||||
|
||||
@@ -521,13 +521,12 @@ AND umbracoNode.id <> @id",
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(pt.Alias))
|
||||
{
|
||||
var e = new InvalidOperationException($"Property Type '{pt.Name}' cannot have an empty Alias. This is most likely due to invalid characters stripped from the Alias.");
|
||||
var ex = new InvalidOperationException($"Property Type '{pt.Name}' cannot have an empty Alias. This is most likely due to invalid characters stripped from the Alias.");
|
||||
|
||||
Logger.Error<ContentTypeRepositoryBase<TEntity>>(e,
|
||||
"Property Type '{PropertyTypeName}' cannot have an empty Alias. This is most likely due to invalid characters stripped from the Alias.",
|
||||
Logger.Error<ContentTypeRepositoryBase<TEntity>>("Property Type '{PropertyTypeName}' cannot have an empty Alias. This is most likely due to invalid characters stripped from the Alias.",
|
||||
pt.Name);
|
||||
|
||||
throw e;
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -537,7 +536,7 @@ AND umbracoNode.id <> @id",
|
||||
{
|
||||
var ex = new InvalidOperationException($"{typeof(TEntity).Name} '{entity.Name}' cannot have an empty Alias. This is most likely due to invalid characters stripped from the Alias.");
|
||||
|
||||
Logger.Error<ContentTypeRepositoryBase<TEntity>>(ex, "{EntityTypeName} '{EntityName}' cannot have an empty Alias. This is most likely due to invalid characters stripped from the Alias.",
|
||||
Logger.Error<ContentTypeRepositoryBase<TEntity>>("{EntityTypeName} '{EntityName}' cannot have an empty Alias. This is most likely due to invalid characters stripped from the Alias.",
|
||||
typeof(TEntity).Name,
|
||||
entity.Name);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user