Fetch RPC error descriptions from API

This commit is contained in:
Daniil Gentili 2017-08-13 18:52:05 +02:00
parent a0ce5c483e
commit 913fc912ee

View File

@ -69,6 +69,12 @@ class RPCErrorException extends \Exception
case -429: case -429:
case 'PEER_FLOOD': $message = 'Too many requests'; break; case 'PEER_FLOOD': $message = 'Too many requests'; break;
} }
if ($this->rpc === $message) {
$res = json_decode(file_get_contents('https://rpc.pwrtelegram.xyz/?description_for='.$this->rpc));
if ($res['ok']) {
$message = $res['result'];
}
}
parent::__construct($message, $code, $previous); parent::__construct($message, $code, $previous);
$this->prettify_tl(); $this->prettify_tl();