<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p>> <span style="font-size:12pt">I understand that Halt is just a way to invite users to debug programming Error, but an Error works equally well.</span></p>
<p><br>
</p>
<p>Related question: Why was Halt designed to behave exactly like an Error? I understand Halt as a note for a programmer to investigate something, but imho it does not indicate that something went wrong, so I would not expect it to abort the process (neglecting
 the fact that there is usually a debugger).</p>
<p>Imagine something like a ProductionToolSet (similar to the approach in <a href="https://wiki.squeak.org/squeak/6633" target="_blank" rel="noopener noreferrer" class="OWAAutoLink" id="LPlnk151076" previewremoved="true">https://wiki.squeak.org/squeak/6633</a>),
 I would assume it should ignore Halts and should just resume. So wouldn't it be better if Halt raised an UnhandledHalt, which could be ignored by certain ToolSets? (I would even propose this behavior for the CommandLineToolSet.)</p>
<p>Please see the attached changeset.</p>
<p><br>
</p>
<p>---</p>
<p><br>
</p>
<p>Concerning AssertionFailures, I think outside of tests, this code</p>
<p><br>
</p>
</div>
<blockquote style="margin:0 0 0 40px; border:none; padding:0px">
<div dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p>1 to: aCollection size do: [:index |</p>
</div>
<div dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p>    <span style="font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:16px">
aCollection</span> remove: (<span style="font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:16px">aCollection at: index)].</span></p>
</div>
<div dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p><span style="font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:16px">self assert: [aCollection isEmpty].</span></p>
</div>
</blockquote>
<div dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p></p>
<p><br>
</p>
<p>should be broadly equivalent to</p>
<p><br>
</p>
<p></p>
</div>
<blockquote style="margin:0 0 0 40px; border:none; padding:0px">
<div dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p>1 to: aCollection size do: [:index |</p>
</div>
<div dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p>    <span style="font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:16px">aCollection</span> remove: (<span style="font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:16px">aCollection
 at: index)].</span></p>
</div>
<div dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p><span style="font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:16px">aCollection isEmpty ifFalse: [</span></p>
</div>
<div dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p><span style="font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:16px">    </span>self error: 'Internal error occurred! Collection is not empty'</p>
<p>    "Unless there is a programmer debugging, execution won't be continued"].</p>
</div>
</blockquote>
<div dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p></p>
<p><br style="font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:16px">
</p>
So I would agree with Marcel's proposal to derive AssertionFailure from Error.</div>
<div dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
Just a few days ago, I realized that an AssertionFaillure raised in a drawing method would damage the image, even if we catch "Error, Warning, Halt".</div>
<div dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
So it seems the right approach to me to refine the definition of exception classes instead of enumerating them at multiple different places.<br>
<p></p>
<p></p>
<p><br>
</p>
<p>Best,</p>
<p>Christoph</p>
<br>
<div style="color:rgb(0,0,0)">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Nicolas Cellier <nicolas.cellier.aka.nice@gmail.com><br>
<b>Gesendet:</b> Montag, 11. November 2019 21:24 Uhr<br>
<b>An:</b> The general-purpose Squeak developers list<br>
<b>Betreff:</b> Re: [squeak-dev] Squeak's AssertionFailure vs. SUnit's TestFailure</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div>Hi Marcel,</div>
<div>Halt is a breakpoint explicitly set in the source code.</div>
<div>In some way, Assertion could be viewed as conditional halt explicitly set in the source code...<br>
</div>
<div>
<div>However, I don't like this POV. IMO AssertionFailure should not be subclass of Halt.</div>
<div>Assertion failures are failure to fullfil some pre/post condition, and as such programming Error.</div>
<div>I understand that Halt is just a way to invite users to debug programming Error, but an Error works equally well.</div>
<div>Why using Halt?<br>
</div>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">Le lun. 11 nov. 2019 à 16:03, Marcel Taeumel <<a href="mailto:marcel.taeumel@hpi.de" target="_blank" rel="noopener noreferrer">marcel.taeumel@hpi.de</a>> a écrit :<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div id="gmail-m_4657551083798119423__MailbirdStyleContent" style="font-size:10pt; font-family:Arial; color:rgb(0,0,0)">
Hi, there.
<div></div>
<div><br>
</div>
<div>The Kernel package provides "AssertionFailure" through "self assert: ...".</div>
<div>The SUnit package provides "TestFailure" through "self assert: ..." in test cases.</div>
<div><br>
</div>
<div><span style="font-size:13.3333px">AssertionFailure is a subclass of Halt.</span><br>
</div>
<div><span style="font-size:13.3333px">TestFailure is a subclass of Exception.</span></div>
<div><span style="font-size:13.3333px"><br>
</span></div>
<div><span style="font-size:13.3333px">Now, the test runner catches all errors (red) and all test failures (yellow). However, the rest runner stops working if an AssertionFailure is raised. The Decompiler can do that, for example. In that case, the user cannot
 easily get an overview of all non-passing tests.</span></div>
<div><span style="font-size:13.3333px"><br>
</span></div>
<div><span style="font-size:13.3333px">Here are my questions:</span></div>
<div><span style="font-size:13.3333px"><br>
</span></div>
<div><span style="font-size:13.3333px">- Should </span><span style="font-size:13.3333px">AssertionFailure be an Error instead of a Halt?</span></div>
<div><span style="font-size:13.3333px">- Should SUnit treat "real" AssertionFailures also as errors (red)?</span></div>
<div><span style="font-size:13.3333px"><br>
</span></div>
<div><span style="font-size:13.3333px">Find attached two changesets with two different strategies.</span></div>
<div><span style="font-size:13.3333px"><br>
</span></div>
<div><span style="font-size:13.3333px">See TestResult >> #runCase: to see which exceptions are caught during test execution.</span></div>
<div><span style="font-size:13.3333px"><br>
</span></div>
<div><span style="font-size:13.3333px">Best,</span></div>
<div><span style="font-size:13.3333px">Marcel</span></div>
</div>
<br>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</body>
</html>