Browse Source

- Fix Exception handling

pull/16/head
Jaussoin Timothée 12 years ago
parent
commit
5f23bac806
  1. 4
      bootstrap.php
  2. 5
      index.php
  3. 2
      system/MovimException.php

4
bootstrap.php

@ -115,7 +115,7 @@ class Bootstrap {
define('HELPERS_PATH', DOCUMENT_ROOT . '/app/helpers/');
define('WIDGETS_PATH', DOCUMENT_ROOT . '/app/widgets/');
define('MOVIM_API', 'http://localhost/api/public/');
define('MOVIM_API', 'https://api.movim.eu/');
if (!defined('DOCTYPE')) {
define('DOCTYPE','text/html');
@ -268,7 +268,7 @@ class Bootstrap {
if(file_exists(DOCUMENT_ROOT.'/config/db.ini')) {
$conf = parse_ini_file(DOCUMENT_ROOT.'/config/db.ini');
} else {
echo 'Cannot find config/db.ini file';
throw new MovimException('Cannot find config/db.ini file');
}
$db->setConnectionArray($conf);

5
index.php

@ -63,8 +63,6 @@ try {
WidgetWrapper::destroyInstance();
} catch (Exception $e) {
//manage errors
//\system\Logs\Logger::displayDebugCSS();
$log = new Logger('movim');
$log->pushHandler(new SyslogHandler('movim'));
$log->addInfo($e->getMessage());
@ -91,6 +89,3 @@ try {
$rqst->handle();
}
}
//display only if not already done and if there is something to display
//\system\Logs\Logger::displayFooterDebug();

2
system/MovimException.php

@ -12,7 +12,7 @@ class MovimException extends Exception
* Forces to add a message.
*/
public function __construct($message, $code = 0) {
parent::__construct(__('error.error', $message), $code);
parent::__construct('Error: ' . $message, $code);
}
/**

Loading…
Cancel
Save