Skip to content

Commit

Permalink
throw exception on error
Browse files Browse the repository at this point in the history
  • Loading branch information
grkamil committed Sep 16, 2020
1 parent 0233fda commit 313a356
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/TelegramHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function __construct($level)
public function write(array $record): void
{
if(!$this->botToken || !$this->chatId) {
return;
throw new \InvalidArgumentException('Bot token or chat id is not defined for Telegram logger');
}

// trying to make request and send notification
Expand All @@ -79,7 +79,7 @@ public function write(array $record): void
])
);
} catch (Exception $exception) {

\Log::channel('single')->error($exception->getMessage());
}
}

Expand Down

0 comments on commit 313a356

Please sign in to comment.