mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-09-02 18:25:11 +00:00
dont alert on 404s
This commit is contained in:
parent
64bd42c61a
commit
84c4a9ed19
2 changed files with 3 additions and 3 deletions
|
@ -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'];
|
||||
|
|
|
@ -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' => '<!channel> ' . Request::getRelativeUri() . "\n" . $e], ['json_data' => true]);
|
||||
Curl::post($slackErrorNotificationUrl, ['text' => ($alert ? '<!channel> ' : '') . Request::getRelativeUri() . "\n" . $e], ['json_data' => true]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue