Skip to content

A free open source IT asset/license management system

Auditing: wrap audit notification in try catch

Marcus Moore82fa1d7a2602
diff --git a/app/Models/Traits/Loggable.php b/app/Models/Traits/Loggable.php
index e7923cfa02..319a409f75 100644
--- a/app/Models/Traits/Loggable.php
+++ b/app/Models/Traits/Loggable.php
@@ -476,7 +476,16 @@ trait Loggable
]);
}
} else {
- Setting::getSettings()->notify(new AuditNotification($params));
+ try {
+ Setting::getSettings()->notify(new AuditNotification($params));
+ } catch (Throwable $e) {
+ Log::error('Audit webhook notification failed', [
+ 'endpoint' => Setting::getSettings()->webhook_endpoint,
+ 'channel' => Setting::getSettings()->webhook_selected,
+ 'exception' => get_class($e),
+ 'error' => $e->getMessage(),
+ ]);
+ }
}
return $log;