Forum Discussion
Philip_Baird
12 years agoCommunity Hero
Hi Scott, I have also found cross Script Unit Exceptions catchable so it is not just your test system.
However, I have found they are not always caught, dependent on where they are thrown.
My observations have been:
1. If an Exception is thrown in a function that is declared in a Script Unit, it can be caught.
2. If an Exception is nested, i.e. is thrown within an Object, Closure based Module or Script Extension, it cannot be caught.
Unfortunately, as I want to use a single Exception handling pattern that works in any situation, I am still using messaging between Script Units to handle Exceptions instead of try catch.
Regards,
Phil Baird
However, I have found they are not always caught, dependent on where they are thrown.
My observations have been:
1. If an Exception is thrown in a function that is declared in a Script Unit, it can be caught.
2. If an Exception is nested, i.e. is thrown within an Object, Closure based Module or Script Extension, it cannot be caught.
Unfortunately, as I want to use a single Exception handling pattern that works in any situation, I am still using messaging between Script Units to handle Exceptions instead of try catch.
Regards,
Phil Baird