/usr/share/mozart/doc/base/exception.html is in mozart-doc 1.4.0-8ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>10.4 Exceptions</TITLE><LINK href="ozdoc.css" rel="stylesheet" type="text/css"></HEAD><BODY><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="time.html#section.control.time"><< Prev</A></TD><TD><A href="node12.html">- Up -</A></TD><TD><A href="thread.html#section.control.threads">Next >></A></TD></TR></TABLE><DIV id="section.control.exceptions"><H2><A name="section.control.exceptions">10.4 Exceptions</A></H2><P> The module <CODE>Exception</CODE> provides procedures to construct exceptions and raise them. </P><DIV class="apropos"><P class="margin">Special Exceptions</P><P> <A name="label726"></A> <A name="label727"></A> <A name="label728"></A> Any value may be raised as exception, although commonly only records are used. Some of these serve special purposes: <EM class="noindex">error exceptions</EM> are records with label <CODE>error</CODE>. These are raised when a programming error occurs; it is not recommended to catch these. <EM class="noindex">System exceptions</EM> are records with label <CODE>system</CODE>. These are raised when an unforeseeable runtime condition occurs; a file operations library might raise system exceptions when a file cannot be opened. It is recommended to always handle such exceptions. <EM class="noindex">Failure exceptions</EM> are records with label <CODE>failure</CODE>; these are raised when a tell operation fails. </P></DIV><DIV class="apropos"><P class="margin">Dispatch Fields</P><P> Both error and system exceptions have a <EM>dispatch field</EM>. This is the subtree at feature <CODE>1</CODE> of the exception record. This is usually a record further describing the exact condition that occurred. </P></DIV><DIV class="apropos"><P class="margin">Debug Information</P><P> If an exception is a record and has a feature <CODE>debug</CODE> with value <CODE><SPAN class="keyword">unit</SPAN></CODE>, then the implementation may replace (depending on the value of the property <CODE>ozconf<SPAN class="keyword">.</SPAN>errorDebug</CODE>) the corresponding subtree by implementation-dependent debugging information. This is to be printed out in the case of uncaught exceptions. </P></DIV><P> All procedures in the Base Environment only ever raise special-purpose exceptions as described above. </P><DL><DT><CODE>error</CODE> <A name="label729"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{Exception<SPAN class="keyword">.</SPAN>error </CODE><CODE><I>X</I></CODE><CODE> </CODE><CODE>?<I>Y</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>returns an error exception record with dispatch field <CODE><I>X</I></CODE>. </P></DD><DT><CODE>system</CODE> <A name="label730"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{Exception<SPAN class="keyword">.</SPAN>system </CODE><CODE><I>X</I></CODE><CODE> </CODE><CODE>?<I>Y</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>returns a system exception record with dispatch field <CODE><I>X</I></CODE>. </P></DD><DT><CODE>failure</CODE> <A name="label731"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{Exception<SPAN class="keyword">.</SPAN>failure </CODE><CODE><I>X</I></CODE><CODE> </CODE><CODE>?<I>Y</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>returns a failure exception. The value <CODE><I>X</I></CODE> may give a hint on why failure occurred; implementations may store this inside the constructed exception's <CODE>debug</CODE> field. </P></DD><DT><A name="label732"></A><SPAN class="index"><CODE>Raise</CODE></SPAN> <A name="label733"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{Exception<SPAN class="keyword">.</SPAN><SPAN class="string">'raise'</SPAN> </CODE><CODE><I>X</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>raises <CODE><I>X</I></CODE> as an exception. </P></DD><DT><CODE>raiseError</CODE> <A name="label734"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{Exception<SPAN class="keyword">.</SPAN>raiseError </CODE><CODE><I>X</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>wraps <CODE><I>X</I></CODE> into an error exception and raises this. This procedure can be defined as follows, except that it always add debug informations: </P><BLOCKQUOTE class="code"><CODE><SPAN class="keyword">proc</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">Exception.raiseError</SPAN> X}<BR> {Exception<SPAN class="keyword">.</SPAN><SPAN class="string">'raise'</SPAN> {AdjoinAt {Exception<SPAN class="keyword">.</SPAN>error X} debug <SPAN class="keyword">unit</SPAN>}}<BR><SPAN class="keyword">end</SPAN></CODE></BLOCKQUOTE><P> </P></DD></DL><P> </P></DIV><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="time.html#section.control.time"><< Prev</A></TD><TD><A href="node12.html">- Up -</A></TD><TD><A href="thread.html#section.control.threads">Next >></A></TD></TR></TABLE><HR><ADDRESS><A href="http://www.ps.uni-sb.de/~duchier/">Denys Duchier</A>, <A href="http://www.ps.uni-sb.de/~kornstae/">Leif Kornstaedt</A> and <A href="http://www.ps.uni-sb.de/~schulte/">Christian Schulte</A><BR><SPAN class="version">Version 1.4.0 (20110908185330)</SPAN></ADDRESS></BODY></HTML>
|