Exception slipping through the catch block?

Bauss jj_1337 at live.dk
Thu Nov 8 16:03:03 UTC 2018


On Thursday, 8 November 2018 at 15:50:38 UTC, helxi wrote:
> On Thursday, 8 November 2018 at 15:41:11 UTC, Adam D. Ruppe 
> wrote:
>> On Thursday, 8 November 2018 at 15:08:40 UTC, helxi wrote:
>>> Shouldn't the catch block in the function catch the exception?
>>
>> You caught Exception, but it throws Error. They have separate 
>> inheritance trees.
>>
>>
>> The common ancestor is actually Throwable, though note that 
>> there is no guarantee that Errors actually unwind the stack; 
>> with certain compile flags they might just abort the program.
>
> Thanks.
>
> Although it's pretty frustrating, isn't it? Now not only I have 
> to think about catching exceptions but also about Errors, and 
> have no guarantee that I have everything under control.

Just don't have errors thrown.


More information about the Digitalmars-d-learn mailing list