Page 1 of 1

Exception object lifetime constrained to Catch scope

Posted: 22 May 2019, 04:28
by swagfag
right now if a catch clause captures an exception, the captured exception will continue to live beyond the scope of the catch clause:

Code: Select all

catch e
{
    ; do something with 'e'
}

; but u could also do something with 'e' here if u like(...maybe)
code like this doesnt make sense. e should be accessible only inside the catch, same way key and value are for the for-each in v2:

Code: Select all

catch e
{
    ; do something with 'e'
}

MsgBox e.Message ; No object to invoke.

Re: Exception object lifetime constrained to Catch scope

Posted: 22 May 2019, 22:18
by lexikos
You are right. I will change it (in v2).