Skip to content

Commit

Permalink
Fix error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
danog committed Feb 24, 2022
1 parent 32b0cc5 commit 62bcda9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/danog/MadelineProto/RPCErrorException.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static function localizeMessage($method, int $code, string $error)
}
$error = \preg_replace('/\\d+$/', "X", $error);
$description = self::$descriptions[$error] ?? '';
if (!isset(self::$errorMethodMap[$code][$method][$error]) || !isset(self::$descriptions[$error]) || $code === 500) {
if (!isset(self::$errorMethodMap[$code][$method][$error]) || !isset(self::$descriptions[$error])) {
Tools::callFork((function () use ($method, $code, $error) {
try {
$res = \json_decode(
Expand Down Expand Up @@ -108,10 +108,10 @@ public function __construct($message = null, $code = 0, $caller = '', Exception
if (isset($level['function']) && $level['function'] === 'methodCall') {
$this->line = $level['line'];
$this->file = $level['file'];
$additional = $level['args'];
}
}
}
$this->getLocalization();
/*
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;
Expand Down

0 comments on commit 62bcda9

Please sign in to comment.