CrugeException.php 791 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
<?php
/**    CrugeException

centraliza la emision de excepciones, ayudando a traducir los mensajes usando CrugeTranslator

@author: Christian Salazar H. <christiansalazarh@gmail.com> @salazarchris74
@license protected/modules/cruge/LICENSE
 */
class CrugeException extends CHttpException
{
    public $classParent;
    public $extra;
    public $code;

    public function __construct($message, $code = 500, $extra = "")
    {
        parent::__construct($code, $message);
        $this->code = $code;
        $this->extra = $extra;
    }

    public function __toString()
    {
        /*
        return $this->classParent . ": [{$this->code}]: ".CrugeTranslator::t($this->message)."\n".$extra;
        */
        return CrugeTranslator::t($this->message) . "<br/>" . $this->code;
    }
}