. */ namespace danog\MadelineProto; class Exception extends \Exception { public function __construct($message, $code = 0, Exception $previous = null) { // some code if (isset($GLOBALS['doingphptests']) && $GLOBALS['doingphptests']) { var_dump($message); } // make sure everything is assigned properly parent::__construct($message, $code, $previous); } /** * ExceptionErrorHandler. * * Error handler */ public function ExceptionErrorHandler($errno = 0, $errstr = null, $errfile = null, $errline = null) { // If error is suppressed with @, don't throw an exception if (error_reporting() === 0) { return true; // return true to continue through the others error handlers } throw new Exception($errstr.' on line '.$errline.' of file '.$errfile, $errno); } }