Discord.Net icon indicating copy to clipboard operation
Discord.Net copied to clipboard

Do not throw the basic Exception type

Open SimonPilkington opened this issue 5 years ago • 3 comments

In several places in the codebase, the basic Exception type is instantiated upon an error, in some cases with a more derived type as the InnerException.

Please consider not doing this. It makes handling exceptions in BaseDiscordClient.Log more complicated. For the case where there is no InnerException (e.g.) provide a derived Exception type. If there is an InnerException (e.g) wrap it in a derived Exception type, or do not wrap it.

SimonPilkington avatar Mar 04 '20 10:03 SimonPilkington

Should we fix this? Absolutely. Will we actually fix this? Probably not.

Right now nothing is really being done as we're waiting for Wumpus.Net to start work on 3.0. If you want to put in a PR to fix this, feel free.

FiniteReality avatar Mar 04 '20 12:03 FiniteReality

I'd be happy to, but would it be worth the effort? Will there be another 2.x release? Or is this code likely to remain in 3.0?

SimonPilkington avatar Mar 04 '20 12:03 SimonPilkington

¯\_(ツ)_/¯

@foxbot is in charge of pushing to NuGet and such, last I checked

FiniteReality avatar Mar 04 '20 12:03 FiniteReality

Willing to pick this up.

AnalogFeelings avatar Apr 16 '24 15:04 AnalogFeelings