字符串长度超长时,提示文案中加上表名,避免有时候异常调用栈看不出来是哪张表

This commit is contained in:
智能大石头 2025-01-02 09:10:41 +08:00
parent 52140de3c7
commit e8ceea7a20
1 changed files with 2 additions and 2 deletions

View File

@ -416,9 +416,9 @@ public partial class Entity<TEntity> : EntityBase, IAccessor where TEntity : Ent
if (uk == null || this[uk.Name] is String str2 && str2.Length > 50) uk = Meta.Unique;
if (uk != null)
throw new ArgumentOutOfRangeException(fi.Name, $"[{fi.Name}/{fi.DisplayName}]长度限制{fi.Length}字符[{uk.Name}={this[uk.Name]}]");
throw new ArgumentOutOfRangeException(fi.Name, $"[{fi.Name}/{fi.DisplayName}@{factory.TableName}]长度限制{fi.Length}字符[{uk.Name}={this[uk.Name]}]");
else
throw new ArgumentOutOfRangeException(fi.Name, $"[{fi.Name}/{fi.DisplayName}]长度限制{fi.Length}字符");
throw new ArgumentOutOfRangeException(fi.Name, $"[{fi.Name}/{fi.DisplayName}@{factory.TableName}]长度限制{fi.Length}字符");
}
}
}