<?php
-class CDBError extends Exception
+class CDBError
{
- public function __construct( $message, $debug = false )
- {
- $this->debug_level = $debug;
- $this->message = $message;
-
- $this->raiseError();
- die();
- }
-
- public function raiseError()
+ static public function raiseError( $exception )
{
echo '<h3>Dabase error: </h3>';
- echo 'Message: ' . $this->getMessage() . '<br />';
- echo 'Code: ' . $this->getCode() . '<br />';
- echo 'Line: ' . $this->getLine() . '<br />';
- echo 'File: ' . $this->getFile() . '<br />';
+ echo 'Message: ' . $exception->getMessage() . '<br />';
+ echo 'Code: ' . $exception->getCode() . '<br />';
+ echo 'Line: ' . $exception->getLine() . '<br />';
+ echo 'File: ' . $exception->getFile() . '<br />';
}
}