Skip to content

Commit 313a356

Browse files
committed
throw exception on error
1 parent 0233fda commit 313a356

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/TelegramHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function __construct($level)
6565
public function write(array $record): void
6666
{
6767
if(!$this->botToken || !$this->chatId) {
68-
return;
68+
throw new \InvalidArgumentException('Bot token or chat id is not defined for Telegram logger');
6969
}
7070

7171
// trying to make request and send notification
@@ -79,7 +79,7 @@ public function write(array $record): void
7979
])
8080
);
8181
} catch (Exception $exception) {
82-
82+
\Log::channel('single')->error($exception->getMessage());
8383
}
8484
}
8585

0 commit comments

Comments
 (0)