Disable rollbar
This commit is contained in:
parent
917e52a2f3
commit
18ee579b63
@ -15,7 +15,7 @@
|
||||
"phpseclib/phpseclib": "dev-master#273ad17",
|
||||
"vlucas/phpdotenv": "^2.4",
|
||||
"erusev/parsedown": "^1.6",
|
||||
"rollbar/rollbar": "~1.1",
|
||||
"rollbar/rollbar": "dev-master",
|
||||
"ext-mbstring": "*",
|
||||
"ext-curl": "*",
|
||||
"ext-xml": "*"
|
||||
|
@ -15,7 +15,7 @@ namespace danog\MadelineProto;
|
||||
class Exception extends \Exception
|
||||
{
|
||||
use TL\PrettyException;
|
||||
|
||||
public static $rollbar = true;
|
||||
public function __toString()
|
||||
{
|
||||
return $this->file === 'MadelineProto' ? $this->message : '\danog\MadelineProto\Exception'.($this->message !== '' ? ': ' : '').$this->message.' in '.$this->file.':'.$this->line.PHP_EOL.'TL Trace (YOU ABSOLUTELY MUST READ THE TEXT BELOW):'.PHP_EOL.$this->getTLTrace();
|
||||
@ -45,7 +45,7 @@ class Exception extends \Exception
|
||||
if (strpos($message, 'pg_query') !== false || strpos($message, 'Undefined variable: ') !== false || strpos($message, 'socket_write') !== false || strpos($message, 'socket_read') !== false || strpos($message, 'Received request to switch to DC ') !== false || strpos($message, "Couldn't get response") !== false || strpos($message, 'Re-executing query...') !== false || strpos($message, "Couldn't find peer by provided") !== false || strpos($message, 'id.pwrtelegram.xyz') !== false || strpos($message, 'Please update ') !== false || strpos($message, 'posix_isatty') !== false) {
|
||||
return;
|
||||
}
|
||||
\Rollbar\Rollbar::log(\Rollbar\Payload\Level::error(), $this, debug_backtrace(0));
|
||||
if (self::$rollbar) \Rollbar\Rollbar::log(\Rollbar\Payload\Level::error(), $this, debug_backtrace(0));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -582,6 +582,9 @@ class MTProto
|
||||
{
|
||||
if (isset($this->settings['logger']['rollbar_token']) && $this->settings['logger']['rollbar_token'] !== '') {
|
||||
@\Rollbar\Rollbar::init(['environment' => 'production', 'root' => __DIR__, 'access_token' => (isset($this->settings['logger']['rollbar_token']) && !in_array($this->settings['logger']['rollbar_token'], ['f9fff6689aea4905b58eec73f66c791d', '300afd7ccef346ea84d0c185ae831718', '11a8c2fe4c474328b40a28193f8d63f5', 'beef2d426496462ba34dcaad33d44a14'])) || $this->settings['pwr']['pwr'] ? $this->settings['logger']['rollbar_token'] : 'c07d9b2f73c2461297b0beaef6c1662f'], false, false);
|
||||
} else {
|
||||
Exception::$rollbar = false;
|
||||
RPCErrorException::$rollbar = false;
|
||||
}
|
||||
\danog\MadelineProto\Logger::constructor($this->settings['logger']['logger'], $this->settings['logger']['logger_param'], isset($this->authorization['user']) ? (isset($this->authorization['user']['username']) ? $this->authorization['user']['username'] : $this->authorization['user']['id']) : '', isset($this->settings['logger']['logger_level']) ? $this->settings['logger']['logger_level'] : Logger::VERBOSE);
|
||||
}
|
||||
|
@ -291,7 +291,7 @@ trait Files
|
||||
} catch (\danog\MadelineProto\RPCErrorException $e) {
|
||||
switch ($e->rpc) {
|
||||
case 'OFFSET_INVALID':
|
||||
\Rollbar\Rollbar::log(\Rollbar\Payload\Level::error(), $e->rpc, ['info' => $message_media, 'offset' => $offset]);
|
||||
//\Rollbar\Rollbar::log(\Rollbar\Payload\Level::error(), $e->rpc, ['info' => $message_media, 'offset' => $offset]);
|
||||
break;
|
||||
case 'FILE_TOKEN_INVALID':
|
||||
$cdn = false;
|
||||
|
@ -576,7 +576,6 @@ trait PeerHandler
|
||||
|
||||
public function resolve_username($username)
|
||||
{
|
||||
//\Rollbar\Rollbar::log($username);
|
||||
$res = $this->method_call('contacts.resolveUsername', ['username' => str_replace('@', '', $username)], ['datacenter' => $this->datacenter->curdc]);
|
||||
if ($res['_'] === 'contacts.resolvedPeer') {
|
||||
return $res;
|
||||
|
@ -16,6 +16,7 @@ class RPCErrorException extends \Exception
|
||||
{
|
||||
use TL\PrettyException;
|
||||
private $fetched = false;
|
||||
public static $rollbar = true;
|
||||
|
||||
public function getMess()
|
||||
{
|
||||
@ -97,7 +98,8 @@ class RPCErrorException extends \Exception
|
||||
if ($this->rpc !== $message) {
|
||||
$this->fetched = true;
|
||||
}
|
||||
/*
|
||||
if (!self::$rollbar) return;
|
||||
|
||||
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;
|
||||
}
|
||||
@ -105,6 +107,5 @@ class RPCErrorException extends \Exception
|
||||
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);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user