diff options
author | n-peugnet <n.peugnet@free.fr> | 2019-11-15 15:57:46 +0100 |
---|---|---|
committer | n-peugnet <n.peugnet@free.fr> | 2019-11-15 15:57:46 +0100 |
commit | c1843c0a2ef49de3d2030398f5c14549cc1791ab (patch) | |
tree | 22fd633cc2f19df053d1e7e2bb8e4a5d134890c8 /index.php | |
parent | e4bc65433283e0725a2e7bf07ae0c84f7905af17 (diff) | |
download | wcms-c1843c0a2ef49de3d2030398f5c14549cc1791ab.tar.gz wcms-c1843c0a2ef49de3d2030398f5c14549cc1791ab.zip |
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
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -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 '<h1>⚠ Woops ! There is a little problem : </h1>', $e->getMessage(), "\n"; } |