Skip to content

Commit

Permalink
字符串长度超长时,提示文案中加上表名,避免有时候异常调用栈看不出来是哪张表
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed Jan 2, 2025
1 parent 52140de commit e8ceea7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions XCode/Entity/Entity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -416,9 +416,9 @@ public override Boolean Valid(DataMethod method)
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}字符");
}
}
}
Expand Down

0 comments on commit e8ceea7

Please sign in to comment.