<?php

require_once '../../Wact/Loader.inc.php';
Wact_Loader::setupWact();

$handler = new Wact_Exception_Handler();
$handler->install();

function Oops() {
    throw new Exception('This is the PHP exception message');
}

function Wrap() {
    try {
        Oops();
    } catch (Exception $e) {
        throw new Wact_Exception_Base('An exception has occurred and been repackaged', $e);
    }
}

echo "This is an example of a standard php Exception, ";
echo "caught and wrapped in a new exception ";
echo "while the Wact_Exception_Handler is active.<br/>\n<hr/>\n";

Wrap();

?>