The text in NH-3500 hints at this only being an issue if you use lazy properties (not the same as collections) which I suspect are used by few. Does this hold in your case?
Apart from that, and this is just a hypothesis, it may also be that few people throw the sort of exceptions you would typically act upon (other than logging/display), from inside the domain model. Similar things can be done with explicit methods/return values to validate things that matter to the surrounding code. If you think you can find the place for where this should be changed in NH, a test case and patch would be entertained. /Oskar 2016-07-29 12:32 GMT+01:00 Mark Perry <[email protected]>: > What I don't get is how folks deal with Exceptions coming from NH objects > since this behaviour was introduced. > > I mean EVER error thrown from Domain Objects needs to have the > innerExceptionChecked. > > Is everyone doing this? > > using (var tran = _session.BeginTransaction()) > { > var customer = _session.Get<Customer>(1); > try { > customer.DoSomething(); > } > catch(TargetInvocationException ex){ > var realExecption = ex.InnnerException; > //Check Exception Type, do some logic etc... > } > tran.Commit(); > } > > It's madness. Yes I understand why it's happening and I get it I just > don't see that its at all useful from a dev standpoint. > > > > Mark > > -- > You received this message because you are subscribed to the Google Groups > "nhusers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/nhusers. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "nhusers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/nhusers. For more options, visit https://groups.google.com/d/optout.
