I don't think code contracts would help too much here. They could help us make FNH less buggy, but that is a different matter. I believe the best way forward (as James mentioned) is a validation layer built in FNH that specifically looks for common mapping errors.
On Wed, Dec 16, 2009 at 5:01 PM, Alex <[email protected]> wrote: > Ok thanks for the clarification. Is this something that could be > handled by code contracts in the next .NET? Or are there too many > permutations to make this feasible? > > On Dec 16, 5:29 am, James Gregory <[email protected]> wrote: >> Fluent NHibernate != NHibernate. We're just a layer ontop of NH. Once we >> pass off our mappings to NH, there's little we can do. We have plans to put >> in a validation layer to try to catch the obvious cases (like missing Id) >> before we pass off to NH, but the cryptic exceptions aren't our doing. >> >> As far as I'm aware, there aren't any cases where there won't be an >> InnerException; the exception is raised only when an NHibernate exception is >> bubbled up. The PotentialReasons collection contains items when you haven't >> configured something through the Fluently.Configure API. It currently >> doesn't contain any details about the mappings themselves. >> >> >> >> On Tue, Dec 15, 2009 at 8:40 PM, Alex <[email protected]> wrote: >> > Hi, >> >> > My question is regarding debugging techniques for >> > FluentConfigurationExceptions when using Automappings. The crux of my >> > issue is listed on StackOverFlow: >> >> >http://stackoverflow.com/questions/1909880/fluent-nhibernate-debuggin... >> >> > When using a fluent configuration, this exception seems to pop up >> > everywhere and can have a variety of different causes. Sometimes >> > drilling into the InnerExceptions helps, sometimes not. I've never >> > seen the PotentialReasons collection contain a single item. I was >> > wondering is there any way to get a better grip on what FNH is trying >> > to do when it crashes and burns this way? Is it currently possible to >> > have FNH output a detailed log of what part of my code it's tripping >> > up on? >> >> > Are there any efforts underway to improve this situation? I'd be happy >> > to contribute some code if a general approach has been outlined. >> >> > -- >> >> > You received this message because you are subscribed to the Google Groups >> > "Fluent NHibernate" group. >> > To post to this group, send email to [email protected]. >> > To unsubscribe from this group, send email to >> > [email protected]<fluent-nhibernate%2Bunsubscr >> > [email protected]> >> > . >> > For more options, visit this group at >> >http://groups.google.com/group/fluent-nhibernate?hl=en. > > -- > > You received this message because you are subscribed to the Google Groups > "Fluent NHibernate" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/fluent-nhibernate?hl=en. > > > -- You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/fluent-nhibernate?hl=en.
