__Delete & Unhandled Exception

Report problems with documented functionality
iseahound
Posts: 307
Joined: 13 Aug 2016, 21:04
GitHub: iseahound

__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: 3356
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: 307
Joined: 13 Aug 2016, 21:04
GitHub: iseahound

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: 6176
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: __Delete & Unhandled Exception

17 May 2018, 04:22

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

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: No registered users and 4 guests