Drawbacks of exceptions being globally allocated

Alexandru Ermicioi alexandru.ermicioi at gmail.com
Sun Aug 15 17:42:15 UTC 2021


On Sunday, 15 August 2021 at 16:23:25 UTC, Ali Çehreli wrote:
> That output contains two automatically chained exceptions:
>
> Failed: Main failed
> This failed too: The destructor failed
>
> Ali

Hmm, wasn't aware of such use case (results of too much java :)). 
Considering this case I'd say it is better to keep it, because 
having more info than less is better for debugging. Even in your 
example, you already catch an use case that wasn't accounted for, 
that may or may not require fixing, i.e. it is better to know it 
then be in blissfull unawareness.

Though it is annoying to view those chained stacks, since they 
have repetitions. It would be nice if stack traces of nested 
exceptions would just show lines up to next exception thrown 
similar to how java does.

Regards,
Alexandru


More information about the Digitalmars-d-learn mailing list