diff --git a/src/Altinn.App.Core/Models/Layout/Components/GroupComponent.cs b/src/Altinn.App.Core/Models/Layout/Components/GroupComponent.cs index ebe2db828..30a0544ee 100644 --- a/src/Altinn.App.Core/Models/Layout/Components/GroupComponent.cs +++ b/src/Altinn.App.Core/Models/Layout/Components/GroupComponent.cs @@ -41,11 +41,11 @@ public virtual void AddChild(BaseComponent child) { if (!this.ChildIDs.Contains(child.Id)) { - throw new ArgumentException($"Child with id {child.Id} is not defined in the child IDs of this group"); + throw new ArgumentException($"Attempted to add child with id {child.Id} to group {this.Id}, but this child is not included in its list of child IDs"); } if (this.Children.FirstOrDefault(c => c.Id == child.Id) != null) { - throw new ArgumentException($"Child with id {child.Id} is already added to this group"); + throw new ArgumentException($"Attempted to add child with id {child.Id} to group {this.Id}, but a child with this id has already added"); } child.Parent = this; this.Children = this.Children.Append(child);