Location: PHPKode > projects > OpenNitro > trunk/Nitro/Error.inc.php
<?php
//
// +---------------------------------------------------------------------------+
// | Nitro :: Errors                                                           |
// +---------------------------------------------------------------------------+
// | Copyright (c) 2003-2006 June Systems BV                                   |
// +---------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or modify it   |
// | under the terms of the GNU Lesser General Public License as published by  |
// | the Free Software Foundation; either version 2.1 of the License, or (at   |
// | your option) any later version.                                           |
// |                                                                           |
// | This library is distributed in the hope that it will be useful, but       |
// | WITHOUT ANY WARRANTY; without even the implied warranty of                |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser   |
// | General Public License for more details.                                  |
// |                                                                           |
// | You should have received a copy of the GNU Lesser General Public License  |
// | along with this library; if not, write to the Free Software Foundation,   |
// | Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA            |
// +---------------------------------------------------------------------------+
// | Authors: Siggi Oskarsson <hide@address.com>                          |
// +---------------------------------------------------------------------------+
//
// $Id: Error.inc.php 229 2008-04-17 09:20:31Z oli $
//
// Nitro debug fake class, this class is included if no debugging is used
//

/**
 * This file contains the Nitro Error handling
 *
 * @package	Nitro
 * @subpackage	Base
 * @author 		Siggi Oskarsson
 * @version 	$Revision: 1.3 $
 * @copyright	2004 June Systems BV
 */

/**
 * Define error levels in Nitro
 */
define("NITRO_NOTICE", 1);
define("NITRO_WARNING", 2);
define("NITRO_ERROR", 4);
define("NITRO_FATAL", 8);

function Error($Error, $File = "", $Line = "", $Level = NITRO_ERROR_WARNING)
{
	switch ($Level) {
		case NITRO_NOTICE:
			Debug("Base", "Error", "INFO: ".$Error, __FILE__, __LINE__, DEBUG_APPL_OK);
			break;
		case NITRO_WARNING:
			Debug("Base", "Error", "WARNING: ".$Error, __FILE__, __LINE__, DEBUG_APPL_WARN);
			break;
		case NITRO_ERROR:
			Debug("Base", "Error", "ERROR: ".$Error, __FILE__, __LINE__, DEBUG_APPL_ERR);
			// handle error
			break;
		default:
		case NITRO_FATAL:
			Debug("Base", "Error", "FATAL: ".$Error, __FILE__, __LINE__, DEBUG_APPL_ERR);
			// handle fatal error
			break;
	}
}
?>
Return current item: OpenNitro