ircbot/Classes/Exception/GeneralException.php
Jan Philipp Timme 26036e9994 [TASK] Made all constuctors and destructors public.
[TASK] Added some DocComments for the IrcClient.
2010-12-18 14:42:56 +00:00

35 lines
802 B
PHP

<?php
/**
* General exception class.
* @author jpt
* @package Exception
* @exception
*/
class Exception_GeneralException extends Exception {
/**
* Constructor. Throws a new exception in case the exception is unknown.
* @throws UnknownException
* @param string $message
* @param int $code
*/
public function __construct($message = "", $code = 0) {
if ($message === "") {
throw new $this('Unknown '. get_class($this));
}
parent::__construct($message, $code);
}
/**
* Puts all the important information into a string.
* @return string
*/
public function __toString() {
$string = get_class($this);
$string .= " :" . $this->message;
$string .= " in " . $this->file . "(" . $this->line . ")";
$string .= "\n" . $this->getTraceAsString();
return $string;
}
}
?>