Thanks! CA2200 exactly explains my confusion. In my real-life case DB driver re-throws its own exception and we loose the name of a query that caused error. It brings a lot of problems in production, when there are many queries in one batch. For me the question is closed, thanks again. Edward, could you please give us a link to bug report when you open one!
2016-06-22 14:52 GMT+03:00 Edward Ned Harvey (mono) < edward.harvey.m...@clevertrove.com>: > > From: mono-list-boun...@lists.ximian.com [mailto:mono-list- > > boun...@lists.ximian.com] On Behalf Of ??????? ????????? > > > > First, just to be sure you know, you *almost* should never catch and > rethrow, because you're not adding new information. If you want to add new > information, generally you should throw a new exception and include an > InnerException. Here are some examples of situations you would want to > catch and rethrow: > https://msdn.microsoft.com/en-us/library/0yd65esw.aspx > > And just to confirm you're right, you *should* expect the stack to be > preserved, if you throw without any arguments. > https://msdn.microsoft.com/en-us/library/ms182363.aspx > > I've confirmed the behavior you reported. In a debug build, on windows, > and on mono, the behavior is not the same on .NET and on mono. It should be. > > I think this is probably an actual bug and I'll go report it. > -- С уважением, Алексей Богомолов horse...@gmail.com
_______________________________________________ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list