This commit is contained in:
Daniil Gentili 2017-08-06 16:05:34 +02:00
parent 420e71bfbc
commit 837f670fa5

View File

@ -71,12 +71,7 @@ class RPCErrorException extends \Exception
} }
parent::__construct($message, $code, $previous); parent::__construct($message, $code, $previous);
$this->prettify_tl(); $this->prettify_tl();
if (in_array($this->rpc, ['CHANNEL_PRIVATE', -404, -429, 'USERNAME_NOT_OCCUPIED', 'ACCESS_TOKEN_INVALID', 'AUTH_KEY_UNREGISTERED', 'SESSION_PASSWORD_NEEDED', 'PHONE_NUMBER_UNOCCUPIED', 'PEER_ID_INVALID', 'CHAT_ID_INVALID', 'USERNAME_INVALID', 'CHAT_WRITE_FORBIDDEN', 'CHAT_ADMIN_REQUIRED', 'PEER_FLOOD'])) {
return;
}
if (strpos($this->rpc, 'FLOOD_WAIT_') !== false) {
return;
}
$additional = []; $additional = [];
foreach ($this->getTrace() as $level) { foreach ($this->getTrace() as $level) {
if (isset($level['function']) && $level['function'] === 'method_call') { if (isset($level['function']) && $level['function'] === 'method_call') {
@ -86,6 +81,15 @@ class RPCErrorException extends \Exception
break; break;
} }
} }
file_get_contents('https://rpc.pwrtelegram.xyz/?method='.$additional[0].'&code='.$code.'&error='.$this->rpc);
/*
if (in_array($this->rpc, ['CHANNEL_PRIVATE', -404, -429, 'USERNAME_NOT_OCCUPIED', 'ACCESS_TOKEN_INVALID', 'AUTH_KEY_UNREGISTERED', 'SESSION_PASSWORD_NEEDED', 'PHONE_NUMBER_UNOCCUPIED', 'PEER_ID_INVALID', 'CHAT_ID_INVALID', 'USERNAME_INVALID', 'CHAT_WRITE_FORBIDDEN', 'CHAT_ADMIN_REQUIRED', 'PEER_FLOOD'])) {
return;
}
if (strpos($this->rpc, 'FLOOD_WAIT_') !== false) {
return;
}
$message === 'Telegram is having internal issues, please try again later.' ? \Rollbar\Rollbar::log(\Rollbar\Payload\Level::critical(), $message) : \Rollbar\Rollbar::log(\Rollbar\Payload\Level::error(), $this, $additional); $message === 'Telegram is having internal issues, please try again later.' ? \Rollbar\Rollbar::log(\Rollbar\Payload\Level::critical(), $message) : \Rollbar\Rollbar::log(\Rollbar\Payload\Level::error(), $this, $additional);
*/
} }
} }