Better error reporting

This commit is contained in:
Daniil Gentili 2017-04-22 01:38:20 +02:00
parent 558246ab90
commit a3e2744099
2 changed files with 2 additions and 0 deletions

View File

@ -20,6 +20,7 @@ class Exception extends \Exception
if (\danog\MadelineProto\Logger::$constructed && $this->file !== __FILE__) { if (\danog\MadelineProto\Logger::$constructed && $this->file !== __FILE__) {
\danog\MadelineProto\Logger::log([$message.' in '.basename($this->file).':'.$this->line], \danog\MadelineProto\Logger::FATAL_ERROR); \danog\MadelineProto\Logger::log([$message.' in '.basename($this->file).':'.$this->line], \danog\MadelineProto\Logger::FATAL_ERROR);
} }
\Rollbar\Rollbar::report_exception($this);
} }
/** /**

View File

@ -21,6 +21,7 @@ class RPCErrorException extends \Exception
case 'CHANNEL_PRIVATE':$message = "You haven't joined this channel/supergroup"; break; case 'CHANNEL_PRIVATE':$message = "You haven't joined this channel/supergroup"; break;
case 'FLOOD_WAIT_666':$message = 'Spooky af m8'; break; case 'FLOOD_WAIT_666':$message = 'Spooky af m8'; break;
case 'BOT_METHOD_INVALID':$message = 'This method cannot be run by a bot'; break; case 'BOT_METHOD_INVALID':$message = 'This method cannot be run by a bot'; break;
default: \Rollbar\Rollbar::report_exception($this);
} }
parent::__construct($message, $code, $previous); parent::__construct($message, $code, $previous);