Skip to content

Commit 375c032

Browse files
committed
Display validation errors
1 parent abf1d11 commit 375c032

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/NHibernate/SchemaValidationException.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,17 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont
2828
base.GetObjectData(info, context);
2929
info.AddValue("ValidationErrors", ValidationErrors);
3030
}
31+
32+
public override string Message
33+
{
34+
get
35+
{
36+
var message = base.Message;
37+
if (ValidationErrors == null || ValidationErrors.Count == 0)
38+
return message;
39+
var errors = "ValidationErrors:" + string.Join(Environment.NewLine + "- ", ValidationErrors);
40+
return message + Environment.NewLine + errors;
41+
}
42+
}
3143
}
3244
}

0 commit comments

Comments
 (0)