This commit is contained in:
Daniil Gentili 2017-04-27 11:59:18 +02:00
parent d68ccd84dc
commit ec79c6d714
3 changed files with 14 additions and 4 deletions

View File

@ -26,7 +26,8 @@ class Exception extends \Exception
if ($file !== null) {
$this->file = $file;
}
\Rollbar\Rollbar::log($this);
if (in_array($message, ['Re-executing query...', 'I had to recreate the temporary authorization key', 'This peer is not present in the internal peer database', "Couldn't get response"])) return;
\Rollbar\Rollbar::log($this, debug_backtrace(), 'error');
}
/**

View File

@ -51,9 +51,16 @@ class RPCErrorException extends \Exception
}
parent::__construct($message, $code, $previous);
if (in_array($message, ['The provided username is not valid', 'The provided token is not valid'])) {
if (in_array($this->rpc, ['CHANNEL_PRIVATE'])) {
return;
}
\Rollbar\Rollbar::log($this);
$additional = [];
foreach (debug_backtrace() as $level) {
if (isset($level['function']) && $level['function'] === 'method_call') {
$additional = $level['args'];
break;
}
}
\Rollbar\Rollbar::log($this, $additional, 'error');
}
}

View File

@ -309,7 +309,9 @@ trait TL
$auto = false;
if ((!is_array($object) || (isset($object['_']) && $this->constructors->find_by_predicate($object['_'])['type'] !== $type['type'])) && in_array($type['type'], ['User', 'InputUser', 'Chat', 'InputChannel', 'Peer', 'InputPeer'])) {
$object = $this->get_info($object)[$type['type']];
$object = $this->get_info($object);
if (!isset($object[$type['type']])) throw new \danog\MadelineProto\Exception("This peer is not present in the internal peer database");
$object = $object[$type['type']];
}
if (!isset($object['_'])) {
$constructorData = $this->constructors->find_by_predicate($type['type'], $layer);