openrat-cms

OpenRat Content Management System
git clone http://git.code.weiherhei.de/openrat-cms.git
Log | Files | Refs

OpenRatException.class.php (649B)


      1 <?php
      2 
      3 namespace util\exception;
      4 use Exception;
      5 
      6 class OpenRatException extends Exception
      7 {
      8 	public $key;
      9 
     10 	// Die Exception neu definieren, damit die Mitteilung nicht optional ist
     11 	public function __construct($key, $message, $code = 0, Exception $previous = null)
     12 	{
     13 
     14 		$this->key = $key;
     15 
     16 		// sicherstellen, dass alles korrekt zugewiesen wird
     17 		parent::__construct($message, $code, $previous);
     18 	}
     19 
     20 	// maßgeschneiderte Stringdarstellung des Objektes
     21 	public function __toString()
     22 	{
     23 		return __CLASS__ . ": " . $this->key . " [{$this->code}]: '{$this->message}' in {$this->file}({$this->line})\n"
     24 			. "{$this->getTraceAsString()}\n";
     25 	}
     26 
     27 }
     28 
     29 
     30 ?>