Refactor Telegram notification error handling

This commit is contained in:
Andras Bacsai
2024-11-22 18:37:51 +01:00
parent 546bcd0dad
commit 7eb955c95a

View File

@@ -72,7 +72,7 @@ class SendMessageToTelegramJob implements ShouldBeEncrypted, ShouldQueue
} }
$response = Http::post($url, $payload); $response = Http::post($url, $payload);
if ($response->failed()) { if ($response->failed()) {
throw new \Exception('Telegram notification failed with '.$response->status().' status code.'.$response->body()); throw new \RuntimeException('Telegram notification failed with '.$response->status().' status code.'.$response->body());
} }
} }
} }