This commit is contained in:
2007-12-15 02:19:09 +00:00
commit 66ca16f8b0
24 changed files with 1199 additions and 0 deletions

41
code/exceptions.php Normal file
View File

@@ -0,0 +1,41 @@
<?php
/*
* Exceptions
*
*/
class BaseException extends Exception {
// Overridden constuctor with message and code parameters, which will optionally display error output
public function __construct( $message = '', $code = 0) {
global $_config;
parent::__construct( $message, $code );
// If debug mode is on, print out the raw data
if( $_config['DEBUG'] ) {
echo get_class($this) . ": Code='{$code}', Message='{$message}'<br />\n";
echo '<pre>';print_r($this->getTrace());echo '</pre>';
}
}
};
class FatalException extends BaseException {
// Overridden constructor prints an error message, then terminates the application
public function __construct( $message = '', $code = 0 ) {
parent::__construct( $message, $code );
die( 'FATAL EXCEPTION: ' . $message );
}
};
class ConfigException extends BaseException {};
class SessionException extends BaseException {};
class AccountLockoutException extends BaseException {};
class AuthenticationException extends BaseException {};
class ParameterException extends BaseException {};
class NotImplementedException extends BaseException {};
?>