From 54e86c20dc866bac973f5ebf61d05fd108f22571 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Tue, 24 Oct 2023 21:32:05 +0200 Subject: [PATCH 1/2] Fix building TelegramException in getCommandsList() This fix the following TypeError: Exception::__construct(): Argument #2 ($code) must be of type int, Exception given --- src/Telegram.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Telegram.php b/src/Telegram.php index 075b6fc6..fd6a45d4 100644 --- a/src/Telegram.php +++ b/src/Telegram.php @@ -303,7 +303,7 @@ public function getCommandsList(): array } } } catch (Exception $e) { - throw new TelegramException('Error getting commands from path: ' . $path, $e); + throw new TelegramException('Error getting commands from path: ' . $path, $e->getCode(), $e); } } From b53c3a8997d3191ba3926dee992e07971ebe0ec1 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Tue, 24 Oct 2023 21:41:37 +0200 Subject: [PATCH 2/2] Don't forward the underlying error code --- src/Telegram.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Telegram.php b/src/Telegram.php index fd6a45d4..05f0b99d 100644 --- a/src/Telegram.php +++ b/src/Telegram.php @@ -303,7 +303,7 @@ public function getCommandsList(): array } } } catch (Exception $e) { - throw new TelegramException('Error getting commands from path: ' . $path, $e->getCode(), $e); + throw new TelegramException('Error getting commands from path: ' . $path, 0, $e); } }