I'm working on a large JSL project that uses many Include() calls to organize the code. I've run into an issue where if one of the included scripts fails, the main script continues executing, which can lead to cascading errors or unexpected behavior.
Currently, I'm considering restructuring my includes to only contain function definitions rather than executable code. The idea is that if an include fails during the definition phase, subsequent calls to those functions would fail more explicitly.
However, I'm wondering if there are better practices for handling this situation. Specifically:
- Is there a way to make
Include() halt execution if the included script encounters an error?
- Is separating function definitions from executable code the recommended approach, or are there other architectural patterns that work better for large JSL projects?
I'd appreciate any insights on how others structure their JSL projects to handle include dependencies robustly.