Skip to content

Commit

Permalink
Merge pull request #290 from silinternational/develop
Browse files Browse the repository at this point in the history
Release 7.0.2 -- don't send user errors to Sentry
  • Loading branch information
briskt authored Sep 6, 2024
2 parents 37e7522 + 22636fa commit a6333a7
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions application/common/config/main.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

use common\components\Emailer;
use notamedia\sentry\SentryTarget;
use Sentry\Event;
use Sil\JsonLog\target\EmailServiceTarget;
use Sil\JsonLog\target\JsonStreamTarget;
use Sil\PhpEnv\Env;
use common\components\Emailer;
use yii\helpers\ArrayHelper;
use yii\helpers\Json;

Expand Down Expand Up @@ -154,7 +154,7 @@
} catch (\Exception $e) {
$appUser = null;
}
if ($appUser && ! \Yii::$app->user->isGuest) {
if ($appUser && !\Yii::$app->user->isGuest) {
$prefixData['user'] = \Yii::$app->user->identity->email;
}

Expand All @@ -176,6 +176,11 @@
'enabled' => !empty(Env::get('SENTRY_DSN')),
'dsn' => Env::get('SENTRY_DSN'),
'levels' => ['error'],
'except' => [
'yii\web\HttpException:401', // Unauthorized
'yii\web\HttpException:404', // NotFound
'yii\web\HttpException:409', // Conflict
],
'context' => true,
// Additional options for `Sentry\init`
// https://docs.sentry.io/platforms/php/configuration/options
Expand Down Expand Up @@ -208,10 +213,10 @@
'i18n' => [
'translations' => [
'*' => [
'class' => 'yii\i18n\PhpMessageSource',
'basePath' => '@frontend/messages',
'class' => 'yii\i18n\PhpMessageSource',
'basePath' => '@frontend/messages',
'sourceLanguage' => '00',
'fileMap' => [
'fileMap' => [
'app' => 'app.php',
'model' => 'model.php',
],
Expand Down

0 comments on commit a6333a7

Please sign in to comment.