DbEntityValidationException.ToString needs more information


Currently DbEntityValidationException just says to look at EntityValidationErrors. Generic loggers don't have that capability, they only look at Message, InnerException, Data, and/or the contents of ToList. And it isn't reasonable to ask those loggers to take on a dependency to EF just to be able to report exceptions.

Calling DbEntityValidationException.ToString should include all of the relevant information about the exception.
Closed Apr 5, 2013 at 7:35 PM by RoMiller
Fixing this would violate security principles of EF. See previous comment for more details.


RoMiller wrote Apr 5, 2013 at 7:34 PM

EF Team Triage: There are a couple of reasons we don't display more into in the exception message:
  1. For security reasons EF never includes any information in exception messages that could reveal data. This is because exception messages may end up being displayed to end users. Because validation errors could include such data we do not include them in the exception message.
  2. There are often multiple errors, we could concatenate them together but this can generate very long text.
For these reasons (#1 in particular) we are unable to make this change to EF.