116 lines
5.5 KiB
HTML
Executable File

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title>LOOP: Exception Object</title>
<style type="text/css" media="all"><!--
@import "../../loop.css";
@import "../../layout1.css";
--></style>
</head>
<body>
<div id="Header">Class Models for Lua</div>
<div id="Logo"><img alt="small (1K)" src="../../small.gif" height="70"></div>
<div id="Menu">
<div class="outside"><div class="inside"><ul>
<li><a href="../../index.html", title="">Home</a></li>
<li><a href="../../release/index.html", title="Installation">Install</a></li>
<li><a href="../../manual/index.html", title="User Manual">Manual</a></li>
<li><a href="../index.html", title="Class Library">Library</a>
<div class="outside"><div class="inside"><ul>
<li><a href="../overview.html#collection", title="Collections">collection</a>
</li>
<li><a href="../overview.html#compiler", title="Compiling">compiler</a>
</li>
<li><a href="../overview.html#debug", title="Debugging">debug</a>
</li>
<li><a href="../overview.html#object", title="Objects">object</a>
</li>
<li><a href="../overview.html#serial", title="Serialization">serial</a>
</li>
<li><a href="../overview.html#thread", title="Threading">thread</a>
</li>
</ul></div></div>
</li>
<li><a href="../../contact.html", title="Contact People">Contact</a></li>
<li><a href="http://luaforge.net/projects/oil/", title="Project at LuaForge">LuaForge</a></li>
</ul></div></div>
</div>
<div class="content">
<h1>Exception Object</h1>
<h2><code>loop.object.Exception</code></h2><br>
<p>Class of objects used to store structured error information that may be captured and processed by an application or used to produce human-readable error messages.
This class is useful to implement expection handling mechanisms.</p>
<p>Each instance may have various fields that describe an error in a structured way so it can be easily processed by an application without the need to parse textual information.
Additionally, these instances may be converted or concatenated to string in order to produce textual descriptions of the errors.</p>
<h2>Behavior</h2>
<h3>Initialization</h3>
<dl>
<dt><code><b>Exception</b>([object])</code></dt>
<dd>
Make <code>object</code> an instance of <code>Exception</code>.
If the <code>debug</code> library of Lua is loaded when this class is first required then the stack traceback is captured when each <code>Exception</code> instance is created.
</dd>
</dl>
<h3>Fields</h3>
<dl>
<dt><code>[<b>1</b>]</code> [optional]</dt>
<dd>
Name of the exception that is used when the textual message describing the exception is generated.
</dd>
</dl>
<h3>Meta-Fields</h3>
<dl>
<dt><code><b>__concat</b></code></dt>
<dd>
Concatenates the textual representation of the exception with a string.
</dd>
<dt><code><b>__tostring</b></code></dt>
<dd>
Generates the textual representation of the exception as a string.
</dd>
</dl>
<h2>Examples</h2>
<h3><a name="$ExampleName">$ExampleDescription</a></h3>
<pre>
-- example missing
</pre>
</div>
<div class="content">
<p><small><strong>Copyright (C) 2004-2008 Tecgraf, PUC-Rio</strong></small></p>
<small>This project is currently being maintained by <a href="http://www.tecgraf.puc-rio.br">Tecgraf</a> at <a href="http://www.puc-rio.br">PUC-Rio</a>.</small>
</div>
</body>
</html>