diff --git a/controller/action/NavActions.class.php b/controller/action/NavActions.class.php index 434fdc31..772aa772 100644 --- a/controller/action/NavActions.class.php +++ b/controller/action/NavActions.class.php @@ -39,7 +39,7 @@ class NavActions extends Actions { $uri = Request::getRelativeUri(); Controller::queueToRunAfterResponse(function() use($uri) { - Slack::sendErrorIfProd('404 for url ' . $uri); + Slack::sendErrorIfProd('404 for url ' . $uri, false); }); Response::setStatus(404); return ['page/404']; diff --git a/lib/tools/Slack.class.php b/lib/tools/Slack.class.php index 5f54f3d0..dd43e56b 100644 --- a/lib/tools/Slack.class.php +++ b/lib/tools/Slack.class.php @@ -3,7 +3,7 @@ class Slack { - public static function sendErrorIfProd($e) + public static function sendErrorIfProd($e, $alert = true) { if ($e instanceof Throwable) { @@ -13,7 +13,7 @@ class Slack $slackErrorNotificationUrl = Config::get('slack_error_notification_url'); if ($slackErrorNotificationUrl) { - Curl::post($slackErrorNotificationUrl, ['text' => ' ' . Request::getRelativeUri() . "\n" . $e], ['json_data' => true]); + Curl::post($slackErrorNotificationUrl, ['text' => ($alert ? ' ' : '') . Request::getRelativeUri() . "\n" . $e], ['json_data' => true]); } } }