Page 1 of 1

__Delete & Unhandled Exception

Posted: 16 May 2018, 05:13
by iseahound
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?

Re: __Delete & Unhandled Exception

Posted: 16 May 2018, 05:50
by nnnik
Sounds like a bug - any command should only throw errors when it is inside a Try/catch block.
Could you share the problematic code?

Re: __Delete & Unhandled Exception

Posted: 16 May 2018, 06:26
by iseahound

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.

Re: __Delete & Unhandled Exception

Posted: 17 May 2018, 04:22
by lexikos
It's already fixed in the test build via commit bfe39d27.

Re: __Delete & Unhandled Exception

Posted: 17 May 2018, 22:47
by iseahound
Thanks! I suspect I'm the only person who initializes classes within a temporary object.