<?php defined('SYSPATH') or die('No direct access allowed.');

/**
 * This class extends the core Kohana exception handling
 *
 * @package    PLA
 * @category   Exceptions
 * @author     Deon George
 * @copyright  (c) phpLDAPadmin Development Team
 * @license    http://dev.phpldapadmin.org/license.html
 */
class PLA_Exception extends Kohana_Exception {
	public function __construct($message, array $variables = NULL, $code = 0) {
		parent::__construct($message,$variables,$code);

		switch ($code) {
			case '400':
				SystemMessage::add('warn',$message);
				Request::current()->redirect('login');
				break;

		}

		echo debug::vars(array('m'=>$message,'v'=>$variables,'c'=>$code,'t'=>$this));die();
	}

	public function __toString() {
		echo __METHOD__;die();
	}
}
?>
