mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Better handling of some alerting errors (#13446)
* Better handling of some alerting errors * Better error output * Consolidate simple template parsing * Fixes reported by phpstan (one was a bug, yay!) * add back forgotten trim * don't remove the template if there is no match * Match previous behavior, which was inconsistent. * use anonymous class for tests instead * Oopsie, Stringable is PHP8+ * fix style
This commit is contained in:
@@ -44,7 +44,8 @@ class AlertTransportController extends Controller
|
||||
return response()->json(['status' => 'ok']);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$result = $e->getMessage();
|
||||
\Log::error($e);
|
||||
$result = basename($e->getFile(), '.php') . ':' . $e->getLine() . ' ' . $e->getMessage();
|
||||
}
|
||||
|
||||
return response()->json([
|
||||
|
||||
Reference in New Issue
Block a user