clear ox=CreateObject("myCollection") TRY ox.Item(null) && <== this fire Collection.Error, and then continue, it is ok ? ox(null) && <== this fire Collection.Error, && and after fire Catched code, it is by design ? ? 'Continue 2' CATCH ? "External try/endtry catching",ERROR(),MESSAGE() ENDTRY DEFINE CLASS myCollection AS Collection Procedure Error(nError, cMethod, nLine) ? "Class error catching",ERROR(),MESSAGE() ENDPROC ENDDEFINE2. I can use this sequence for escalade a error
TRY
THROW
ENDTRY
but on collection.Item method i have found a specific problemclear ox=CreateObject("myCollection") TRY ox.Item(1) ? 'Continue' CATCH ? "External try/endtry catching",ERROR(),MESSAGE() ENDTRY DEFINE CLASS myCollection AS Collection PROCEDURE item(zz) RETURN DODEFAULT(ZZ) ENDPROC Procedure Error(nError, cMethod, nLine) ? "Class error catching",ERROR(),MESSAGE() TRY THROW && this escalade the error to the first try/endtry level ENDTRY ENDPROC ENDDEFINEbut next code fire a not trappable error, like a single THROW line
clear ox=CreateObject("myCollection") TRY ox.Item(1) ? 'Continue' CATCH ? "External try/endtry catching",ERROR(),MESSAGE() ENDTRY DEFINE CLASS myCollection AS Collection *!* PROCEDURE item(zz) *!* RETURN DODEFAULT(ZZ) *!* ENDPROC Procedure Error(nError, cMethod, nLine) ? "Class error catching",ERROR(),MESSAGE() TRY THROW && this fire a not trappable error ENDTRY ENDPROC ENDDEFINEThanks.