Exception object lifetime constrained to Catch scope

Propose new features and changes
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Exception object lifetime constrained to Catch scope

22 May 2019, 04:28

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.
lexikos
Posts: 9592
Joined: 30 Sep 2013, 04:07
Contact:

Re: Exception object lifetime constrained to Catch scope

22 May 2019, 22:18

You are right. I will change it (in v2).

Return to “Wish List”

Who is online

Users browsing this forum: No registered users and 56 guests