L
Laura Stern
Guest
Yes - at first this is not intuitive. The error you are throwing inside doIt(), is raising error inside that procedure. Errors do not bubble out of blocks, ever, unless UNDO, THROW is in effect. So if you'd had a CATCH block inside doIt, it would have run. With ROUTINE-LEVEL ON ERROR UNDO, THROW, it is saying that when error gets raised in doIt(), instead of just doing an UNDO, LEAVE, it will throw the error out of the block, up to the caller in this case. So then error gets raised again in the caller, at the RUN statement. So then your CATCH block will run.
Continue reading...
Continue reading...