cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.
  • See how to access JMP Marketplace - and - find, create & share add-ins to extend your JMP. Watch video.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
shuey
Level II

Best practices for error handling with Include() calls in large JSL projects?

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:

  1. Is there a way to make Include() halt execution if the included script encounters an error?
  2. 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.

1 REPLY 1
jthi
Super User

Re: Best practices for error handling with Include() calls in large JSL projects?

I think one option is to wrap your includes with Try()

 

test1.jsl

Names Default To Here(1);

show

test2.jsl

Names Default To Here(1);

Try(
	Include("test1.jsl");
,
	Throw(Char(exception_msg));
);

Show("not executed");
-Jarmo

Recommended Articles