Won't Fix
Details
Details
Assignee
Dario Quintana
Dario QuintanaReporter
korkless
korklessComponents
Affects versions
Priority
Who's Looking?
Open Who's Looking?
Created February 24, 2011 at 8:45 AM
Updated January 11, 2012 at 4:44 AM
Resolved March 10, 2011 at 4:10 PM
at the moment the message of the exception contains only the class name, i suggest to add also same info
about the invalid values. there is my suggestion
public class InvalidStateException : HibernateException
{
....
public InvalidStateException(InvalidValue[] invalidValues, String className)
: base(FormatMessage(invalidValues, className))
....
private static string FormatMessage(InvalidValue[] invalidValues, String className)
{
StringBuilder msg = new StringBuilder("validation failed for " + className + ":");
foreach(InvalidValue item in invalidValues)
{
if (!string.IsNullOrEmpty(item.PropertyName))
{
msg.Append(item.PropertyName + ":");
}
msg.AppendLine(item.Message);
}
return msg.ToString();
}
}