From c1843c0a2ef49de3d2030398f5c14549cc1791ab Mon Sep 17 00:00:00 2001 From: n-peugnet Date: Fri, 15 Nov 2019 15:57:46 +0100 Subject: feat: load Sentry browser as an external script - better way to check if we need to report errors in PHP - fix make file $(js_bundles) dependencies (add webpack conf) - update sentry-browser sdk and move it to dev requirements --- index.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index 13f7bfa..fd9fdaa 100644 --- a/index.php +++ b/index.php @@ -13,7 +13,8 @@ require('./vendor/autoload.php'); $app = new Wcms\Application(); $app->wakeup(); -try { + +if (isreportingerrors()) { Sentry\init([ 'dsn' => Wcms\Config::sentrydsn(), 'release' => getversion(), @@ -25,8 +26,6 @@ try { 'username' => Wcms\Config::basepath(), ]); }); -} catch (Throwable $th) { - // No problem: Sentry is optionnal } try { @@ -34,10 +33,8 @@ try { $matchoper->match(); } catch (Exception $e) { - try { + if (isreportingerrors()) { Sentry\captureException($e); - } catch (Throwable $th) { - // No problem: Sentry is optionnal } echo '

⚠ Woops ! There is a little problem :

', $e->getMessage(), "\n"; } -- cgit v1.2.3