docs icon indicating copy to clipboard operation
docs copied to clipboard

Conflicting recommendations for throwing system.exception

Open Greydog1 opened this issue 2 years ago • 5 comments

This page gives an example using Throw system.exception, while this page says not to throw system.exception.


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

Greydog1 avatar May 04 '23 19:05 Greydog1

Thanks for reporting this @Greydog1

This page should change to use a different exception type.

I'll add this to our backlog, and add the "help-wanted" label in case someone wants to submit a PR before we make the change.

BillWagner avatar May 05 '23 14:05 BillWagner

This page gives an example using Throw system.exception,

Which is "This" page?

shivam-51 avatar May 06 '23 13:05 shivam-51

@shivam-51 It's the following page, which is mentioned in the original post in the Document Details section: https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/throw-statement

image

pkulikov avatar May 06 '23 14:05 pkulikov

This page should change to use a different exception type.

@BillWagner What can be the different exception type? I feel the purpose of that document is to show how to throw a generic exception and it does so. If we want to replace it we need to add a generic exception instead of the Exception.

shivam-51 avatar May 07 '23 04:05 shivam-51

@BillWagner I'll work on this!

BartoszKlonowski avatar Jul 11 '23 09:07 BartoszKlonowski