<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Best practices for error handling with Include() calls in large JSL projects? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Best-practices-for-error-handling-with-Include-calls-in-large/m-p/923373#M108178</link>
    <description>&lt;P&gt;I think one option is to wrap your includes with Try()&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;test1.jsl&lt;/EM&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

show&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;EM&gt;test2.jsl&lt;/EM&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

Try(
	Include("test1.jsl");
,
	Throw(Char(exception_msg));
);&lt;BR /&gt;&lt;BR /&gt;Show("not executed");&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 12 Jan 2026 12:07:57 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2026-01-12T12:07:57Z</dc:date>
    <item>
      <title>Best practices for error handling with Include() calls in large JSL projects?</title>
      <link>https://community.jmp.com/t5/Discussions/Best-practices-for-error-handling-with-Include-calls-in-large/m-p/923340#M108175</link>
      <description>&lt;P&gt;I'm working on a large JSL project that uses many &lt;CODE class="rounded bg-muted px-1.5 py-0.5 font-mono text-sm" data-streamdown="inline-code"&gt;Include()&lt;/CODE&gt; 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.&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;However, I'm wondering if there are better practices for handling this situation. Specifically:&lt;/P&gt;
&lt;OL class="list-inside list-decimal whitespace-normal" data-streamdown="ordered-list"&gt;
&lt;LI class="py-1 [&amp;amp;&amp;gt;p]:inline" data-streamdown="list-item"&gt;Is there a way to make &lt;CODE class="rounded bg-muted px-1.5 py-0.5 font-mono text-sm" data-streamdown="inline-code"&gt;Include()&lt;/CODE&gt; halt execution if the included script encounters an error?&lt;/LI&gt;
&lt;LI class="py-1 [&amp;amp;&amp;gt;p]:inline" data-streamdown="list-item"&gt;Is separating function definitions from executable code the recommended approach, or are there other architectural patterns that work better for large JSL projects?&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;I'd appreciate any insights on how others structure their JSL projects to handle include dependencies robustly.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jan 2026 09:31:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Best-practices-for-error-handling-with-Include-calls-in-large/m-p/923340#M108175</guid>
      <dc:creator>shuey</dc:creator>
      <dc:date>2026-01-12T09:31:23Z</dc:date>
    </item>
    <item>
      <title>Re: Best practices for error handling with Include() calls in large JSL projects?</title>
      <link>https://community.jmp.com/t5/Discussions/Best-practices-for-error-handling-with-Include-calls-in-large/m-p/923373#M108178</link>
      <description>&lt;P&gt;I think one option is to wrap your includes with Try()&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;test1.jsl&lt;/EM&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

show&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;EM&gt;test2.jsl&lt;/EM&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

Try(
	Include("test1.jsl");
,
	Throw(Char(exception_msg));
);&lt;BR /&gt;&lt;BR /&gt;Show("not executed");&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Jan 2026 12:07:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Best-practices-for-error-handling-with-Include-calls-in-large/m-p/923373#M108178</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2026-01-12T12:07:57Z</dc:date>
    </item>
  </channel>
</rss>

