<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Uncaught throw terminates script silently?]]></title><description><![CDATA[<p>the following line:</p>
<p>throw "arbitrary string"; // or throw 2; or throw true;<br><br></p>
<p>if uncaught, terminates my script but does not show up in the console with any "Uncaught blah blah blah" or any kind of error. No error notifications or anything. It just silently terminates the script.</p>
<p> </p>
<p>if i change it to:</p>
<p>throw new Error("arbitrary string");</p>
<p>it will then show up in the console and i will receive error notifications, but shouldn't the first method be valid as well? Using the MDN page on "throw" as a reference made me think it should. </p>
<p>Is this a bug in the game? or am I just misunderstanding something?</p>
<p>EDIT: just as a side note, i am fairly certain the first method used to work, and now it doesnt, but i could be remembering incorrectly.</p>]]></description><link>http://screeps.com/forum/topic/577/uncaught-throw-terminates-script-silently</link><generator>RSS for Node</generator><lastBuildDate>Sun, 15 Mar 2026 02:29:43 GMT</lastBuildDate><atom:link href="http://screeps.com/forum/topic/577.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 15 Oct 2016 14:12:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Uncaught throw terminates script silently? on Invalid Date]]></title><description><![CDATA[<p>the following line:</p>
<p>throw "arbitrary string"; // or throw 2; or throw true;<br><br></p>
<p>if uncaught, terminates my script but does not show up in the console with any "Uncaught blah blah blah" or any kind of error. No error notifications or anything. It just silently terminates the script.</p>
<p> </p>
<p>if i change it to:</p>
<p>throw new Error("arbitrary string");</p>
<p>it will then show up in the console and i will receive error notifications, but shouldn't the first method be valid as well? Using the MDN page on "throw" as a reference made me think it should. </p>
<p>Is this a bug in the game? or am I just misunderstanding something?</p>
<p>EDIT: just as a side note, i am fairly certain the first method used to work, and now it doesnt, but i could be remembering incorrectly.</p>]]></description><link>http://screeps.com/forum/post/2819</link><guid isPermaLink="true">http://screeps.com/forum/post/2819</guid><dc:creator><![CDATA[Helam]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Uncaught throw terminates script silently? on Invalid Date]]></title><description><![CDATA[<p>You can throw whatever you want. That doesn't mean the try{} that implicitly surrounds your code has to catch it gracefully.</p>]]></description><link>http://screeps.com/forum/post/2820</link><guid isPermaLink="true">http://screeps.com/forum/post/2820</guid><dc:creator><![CDATA[sparr]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Uncaught throw terminates script silently? on Invalid Date]]></title><description><![CDATA[<p>It is generally accepted that you throw Errors; the cost of instantiating an Error is far less impactful than that of triggering the exception mechanism, so it is in your best interest to do so.</p>
<p>Also, <a href="http://www.devthought.com/2011/12/22/a-string-is-not-an-error/" target="_blank" rel="nofollow noreferrer">http://www.devthought.com/2011/12/22/a-string-is-not-an-error/</a>.</p>]]></description><link>http://screeps.com/forum/post/2821</link><guid isPermaLink="true">http://screeps.com/forum/post/2821</guid><dc:creator><![CDATA[Prime]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>