From a3e2744099da60186d83b7b6ed540d7398b574cf Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Sat, 22 Apr 2017 01:38:20 +0200 Subject: [PATCH] Better error reporting --- src/danog/MadelineProto/Exception.php | 1 + src/danog/MadelineProto/RPCErrorException.php | 1 + 2 files changed, 2 insertions(+) diff --git a/src/danog/MadelineProto/Exception.php b/src/danog/MadelineProto/Exception.php index 3ffb9c37..98962e6f 100644 --- a/src/danog/MadelineProto/Exception.php +++ b/src/danog/MadelineProto/Exception.php @@ -20,6 +20,7 @@ class Exception extends \Exception if (\danog\MadelineProto\Logger::$constructed && $this->file !== __FILE__) { \danog\MadelineProto\Logger::log([$message.' in '.basename($this->file).':'.$this->line], \danog\MadelineProto\Logger::FATAL_ERROR); } + \Rollbar\Rollbar::report_exception($this); } /** diff --git a/src/danog/MadelineProto/RPCErrorException.php b/src/danog/MadelineProto/RPCErrorException.php index ad7d1e55..9c59e813 100644 --- a/src/danog/MadelineProto/RPCErrorException.php +++ b/src/danog/MadelineProto/RPCErrorException.php @@ -21,6 +21,7 @@ class RPCErrorException extends \Exception case 'CHANNEL_PRIVATE':$message = "You haven't joined this channel/supergroup"; break; case 'FLOOD_WAIT_666':$message = 'Spooky af m8'; 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);