<?php
define("ABS_PATH", $_SERVER['DOCUMENT_ROOT']);
include(ABS_PATH . "/head_nav.php");
include(ABS_PATH . "/middle.php");
?>
          <div class="section">
            <div class="toc-wrapper">
              <span class="toc-title">Contents:</span>
              <ul class="toc">
                  <li class=""><a href="#SYNOPSIS">SYNOPSIS</a></li>
                  <li class=""><a href="#DESCRIPTION">DESCRIPTION</a></li>
                  <li class=""><a href="#METHODS">METHODS</a></li>
                  <li class="sub"><a href="#method_type">type()</a></li>
                  <li class="sub"><a href="#method_info">info()</a></li>
                  <li class=""><a href="#AUTHOR">AUTHOR</a></li>
                  <li class=""><a href="#COPYRIGHT">COPYRIGHT</a></li>
                  <li class=""><a href="#SEE_ALSO">SEE ALSO</a></li>
              </ul>
            </div>
          </div>
          
                <div class="pod">
            <div class="section">
              <div class="head">
                <h1 id="SYNOPSIS">SYNOPSIS</h1>
                <a href="#body" class="top" title="Back up to the top of the page" >Top</a>
              </div>
              <div class="body">
                <pre>use Template::Exception;

my $exception = Template::Exception-&gt;new($type, $info);
$type = $exception-&gt;type;
$info = $exception-&gt;info;
($type, $info) = $exception-&gt;type_info;

print $exception-&gt;as_string();

$handler = $exception-&gt;select_handler(\@candidates);</pre>
              </div>
            </div>
            <div class="section">
              <div class="head">
                <h1 id="DESCRIPTION">DESCRIPTION</h1>
                <a href="#body" class="top" title="Back up to the top of the page" >Top</a>
              </div>
              <div class="body">
                <p>
                      The <code>Template::Exception</code> module defines an object class for
                      representing exceptions within the template processing life cycle.
                      Exceptions can be raised by modules within the Template Toolkit, or can
                      be generated and returned by user code bound to template variables.
                    </p>
                    <p>
                      Exceptions can be raised in a template using the <code>THROW</code>
                      directive,
                    </p>
                    <pre><span class="tt">[% THROW user.login 'no user id: please login' %]</span></pre>
                    <p>
                      or by calling the <a href="../../modules/Template/Context.php#method_throw">throw()</a> method on the current <a href="../../modules/Template/Context.php">Template::Context</a> object,
                    </p>
                    <pre>$context-&gt;throw('user.passwd', 'Incorrect Password');
$context-&gt;throw('Incorrect Password');    # type 'undef'</pre>
                    <p>
                      or from Perl code by calling <code>die()</code> with a
                      <code>Template::Exception</code> object,
                    </p>
                    <pre>die (Template::Exception-&gt;new('user.denied', 'Invalid User ID'));</pre>
                    <p>
                      or by simply calling <code>die()</code> with an error string. This is
                      automagically caught and converted to an exception of
                      '<code>undef</code>' type (that's the literal string '<code>undef</code>'
                      rather than Perl's undefined value) which can then be handled in the
                      usual way.
                    </p>
                    <pre>die "I'm sorry Dave, I can't do that";</pre>
                    <p>
                      Each exception is defined by its type and a information component (e.g.
                      error message). The type can be any identifying string and may contain
                      dotted components (e.g. '<code>foo</code>', '<code>foo.bar</code>',
                      '<code>foo.bar.baz</code>'). Exception types are considered to be
                      hierarchical such that '<code>foo.bar</code>' would be a specific type of
                      the more general '<code>foo</code>' type.
                    </p>
              </div>
            </div>
            <div class="section">
              <div class="head">
                <h1 id="METHODS">METHODS</h1>
                <a href="#body" class="top" title="Back up to the top of the page" >Top</a>
              </div>
              <div class="body">
                <div class="subsection">
                  <div class="head">
                    <h2 id="method_type" class="method" onclick="switch_subsection(this)" title="Click title to show/hide sub-section content.">type()</h2>
                    <a href="#body" class="top" title="Back up to the top of the page" >Top</a>
                  </div>
                  <div class="body">
                    <p>
                          Returns the exception type.
                        </p>
                  </div>
                </div>    <div class="subsection">
                  <div class="head">
                    <h2 id="method_info" class="method" onclick="switch_subsection(this)" title="Click title to show/hide sub-section content.">info()</h2>
                    <a href="#body" class="top" title="Back up to the top of the page" >Top</a>
                  </div>
                  <div class="body">
                    <p>
                          Returns the exception information.
                        </p>
                  </div>
                </div>
              </div>
            </div>
            <div class="section">
              <div class="head">
                <h1 id="AUTHOR">AUTHOR</h1>
                <a href="#body" class="top" title="Back up to the top of the page" >Top</a>
              </div>
              <div class="body">
                <p>
                      Andy Wardley &lt;abw@wardley.org&gt; <a
                      href="https://wardley.org/">https://wardley.org/</a>
                    </p>
              </div>
            </div>
            <div class="section">
              <div class="head">
                <h1 id="COPYRIGHT">COPYRIGHT</h1>
                <a href="#body" class="top" title="Back up to the top of the page" >Top</a>
              </div>
              <div class="body">
                <p>
                      Copyright (C) 1996-2007 Andy Wardley. All Rights Reserved.
                    </p>
                    <p>
                      This module is free software; you can redistribute it and/or modify it
                      under the same terms as Perl itself.
                    </p>
              </div>
            </div>
            <div class="section">
              <div class="head">
                <h1 id="SEE_ALSO">SEE ALSO</h1>
                <a href="#body" class="top" title="Back up to the top of the page" >Top</a>
              </div>
              <div class="body">
                <p>
                      <a href="../../modules/Template.php">Template</a>, <a href="../../modules/Template/Context.php">Template::Context</a>
                    </p>
              </div>
            </div>
            
            </div>
<?php include(ABS_PATH . "/footer.php"); ?>
