Add PrettyException to ConversionException

This commit is contained in:
Daniil Gentili 2018-10-13 15:26:59 +00:00
parent e694df4a48
commit deee5a4dfd

View File

@ -15,4 +15,16 @@ namespace danog\MadelineProto\TL\Conversion;
class Exception extends \Exception class Exception extends \Exception
{ {
use \danog\MadelineProto\TL\PrettyException;
public function __toString()
{
return get_class($this).($this->message !== '' ? ': ' : '').$this->message.PHP_EOL.@file_get_contents(__DIR__.'/../../../.git/refs/heads/master').PHP_EOL.'TL Trace (YOU ABSOLUTELY MUST READ THE TEXT BELOW):'.PHP_EOL.PHP_EOL.$this->getTLTrace().PHP_EOL;
}
public function __construct($message, $file = '')
{
parent::__construct($message);
$this->prettify_tl($file);
}
} }