Project

General

Profile

« Previous | Next » 

Revision 1670

Added by darkviper over 12 years ago

added new global exceptionhandler (class AppException)

View differences:

branches/2.8.x/CHANGELOG
11 11
! = Update/Change
12 12
===============================================================================
13 13

  
14
17 Apr-2012 Build 1669 Dietmar Woellbrink (Luisehahne)
14
17 Apr-2012 Build 1670 Werner v.d.Decken(DarkViper)
15
+ added new global exceptionhandler (class AppException)
16
17 Apr-2012 Build 1669 Werner v.d.Decken(DarkViper)
15 17
# little fixes in /admin/addons/reload.php
16 18
17 Apr-2012 Build 1668 Dietmar Woellbrink (Luisehahne)
17 19
! settigs.php add fields dev_infos and page_icon_dir
branches/2.8.x/wb/admin/interface/version.php
51 51

  
52 52
// check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
53 53
if(!defined('VERSION')) define('VERSION', '2.8.3');
54
if(!defined('REVISION')) define('REVISION', '1669');
54
if(!defined('REVISION')) define('REVISION', '1670');
55 55
if(!defined('SP')) define('SP', '');
branches/2.8.x/wb/framework/globalExceptionHandler.php
16 16
/**
17 17
 * define several default exceptions directly to prevent from extra loading requests
18 18
 */
19

  
20 19
/**
20
 * 
21
 */
22
	class AppException extends Exception{
23
		public function __toString() {
24
			$file = str_replace(dirname(dirname(__FILE__)), '', $this->getFile());
25
			if(DEBUG) {
26
				$trace = $this->getTrace();
27
				$result = 'Exception: "'.$this->getMessage().'" @ ';
28
				if($trace[0]['class'] != '') {
29
				  $result .= $trace[0]['class'].'->';
30
				}
31
				$result .= $trace[0]['function'].'(); in'.$file.'<br />'."\n";
32
				if(mysql_errno()) {
33
					$result .= mysql_errno().': '.mysql_error().'<br />'."\n";
34
				}
35
			}else {
36
				$result = 'Exception: "'.$this->getMessage().'" in ['.$file.']<br />'."\n";
37
			}
38
			return $result;
39
		}
40
	}
41
/**
21 42
 * define Exception to show error after accessing a forbidden file
22 43
 */
23 44
	class IllegalFileException extends LogicException {

Also available in: Unified diff