__Delete & Unhandled Exception

Report problems with documented functionality
iseahound
Posts: 1444
Joined: 13 Aug 2016, 21:04
Contact:

__Delete & Unhandled Exception

16 May 2018, 05:13

In Version 1.1.28
Changed __Delete to catch and report exceptions when called during object cleanup. It previously had the (erroneous) effect of "postponing" the exception until the next function call or the end of the try-block/thread.
Now when I run FileDelete it throws a message box. Could someone elaborate on this design choice? The error has to be captured via catch or suppressed using try with no complementary catch statement. Is the idea to force users to use try, catch, finally within __Delete?
User avatar
nnnik
Posts: 4500
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: __Delete & Unhandled Exception

16 May 2018, 05:50

Sounds like a bug - any command should only throw errors when it is inside a Try/catch block.
Could you share the problematic code?
Recommends AHK Studio
iseahound
Posts: 1444
Joined: 13 Aug 2016, 21:04
Contact:

Re: __Delete & Unhandled Exception

16 May 2018, 06:26

Code: Select all

start({"provider":new test()})

start(obj){
obj.provider := ""
}

class test{
            __Delete(){
               FileDelete, % this.temp1
               try FileDelete, % this.temp2 ; ImageData
               try FileDelete, % this.temp3
            }
}
try FileDelete gives no error. FileDelete throws Unhandled Exception.
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: __Delete & Unhandled Exception

17 May 2018, 04:22

It's already fixed in the test build via commit bfe39d27.
iseahound
Posts: 1444
Joined: 13 Aug 2016, 21:04
Contact:

Re: __Delete & Unhandled Exception

17 May 2018, 22:47

Thanks! I suspect I'm the only person who initializes classes within a temporary object.

Return to “Bug Reports”

Who is online

Users browsing this forum: niCode and 13 guests