Skip to content

Commit

Permalink
Exception types
Browse files Browse the repository at this point in the history
  • Loading branch information
murrant committed Nov 4, 2024
1 parent aed82f4 commit 84cb4f5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions LibreNMS/Alert/Transport/Mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ public function deliverAlert(array $alert_data): bool

try {
return \LibreNMS\Util\Mail::send($emails, $alert_data['title'], $msg, $html, $this->config['bcc'] ?? false, $this->config['attach-graph'] ?? null);
} catch (\PHPMailer\PHPMailer\Exception $e) {
throw new AlertTransportDeliveryException($alert_data, 0, $e->errorMessage());
} catch (Exception $e) {
throw new AlertTransportDeliveryException($alert_data, 0, $e->getMessage());
}
Expand Down
2 changes: 1 addition & 1 deletion LibreNMS/Util/Mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static function parseEmails($emails)
* @param bool|null $embedGraphs
* @return bool
*
* @throws \PHPMailer\PHPMailer\Exception
* @throws \PHPMailer\PHPMailer\Exception|Exception if delivery fails
*/
public static function send($emails, $subject, $message, bool $html = false, bool $bcc = false, ?bool $embedGraphs = null): bool
{
Expand Down

0 comments on commit 84cb4f5

Please sign in to comment.