Re: Mono does not include full stacktrace while rethrowing exception

Bernhard Urban <[email protected]>
Newsgroups gmane.comp.gnome.mono.general,gmane.spam.detected
Message-ID <[email protected]>
I agree with Edward, here's a PR: https://github.com/mono/mono/pull/3201

-Bernhard

________________________________________
From: [email protected] <[email protected]> on behalf of Edward Ned Harvey (mono) <[email protected]>
Sent: Wednesday, June 22, 2016 4:52 AM
To: Алексей Богомолов; [email protected]
Subject: Re: [Mono-list] Mono does not include full stacktrace while rethrowing exception

> From: [email protected] [mailto:mono-list-
> [email protected]] 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://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2f0yd65esw.aspx&data=01%7c01%7cbeurba%40microsoft.com%7c8f639762e9994b298d1308d39aa0b29e%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=r%2fwVA7R%2fwmNwL59E03eJ9lzTA7HuOkswoPcSe2V8ago%3d

And just to confirm you're right, you *should* expect the stack to be preserved, if you throw without any arguments.
https://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fms182363.aspx&data=01%7c01%7cbeurba%40microsoft.com%7c8f639762e9994b298d1308d39aa0b29e%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=PcQ5QhsbXHxVUhu2vJKNRTAdoYFrbgaShShhNmSXFB0%3d

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.
_______________________________________________
Mono-list maillist  -  [email protected]
https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2flists.ximian.com%2fmailman%2flistinfo%2fmono-list&data=01%7c01%7cbeurba%40microsoft.com%7c8f639762e9994b298d1308d39aa0b29e%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=VayCRiA7CUa04VaCV3lZ4%2bLYsJJl9ApomsOSmWcS4TU%3d
_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.