diff options
author | n-peugnet <n.peugnet@free.fr> | 2019-11-07 01:42:54 +0100 |
---|---|---|
committer | n-peugnet <n.peugnet@free.fr> | 2019-11-07 01:42:54 +0100 |
commit | a1a97e168a5d3c802f12e7351b13dab0a4f68db2 (patch) | |
tree | a6fca5cc9a8e3e9ba7bc2e93ce59b00a503302b0 | |
parent | 494da5f44937e55dc1e3180b62e2e6ef98eecc9f (diff) | |
download | wcms-a1a97e168a5d3c802f12e7351b13dab0a4f68db2.tar.gz wcms-a1a97e168a5d3c802f12e7351b13dab0a4f68db2.zip |
feat: better sentry conf + send catched errors
-rw-r--r-- | index.php | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -13,13 +13,24 @@ require('./vendor/autoload.php'); $app = new Wcms\Application(); $app->wakeup(); -Sentry\init(['dsn' => Wcms\Config::sentrydsn()]); +Sentry\init([ + 'dsn' => Wcms\Config::sentrydsn(), + 'release' => 'w_cms_v' . getversion(), + 'project_root' => 'app', +]); +Sentry\configureScope(function (Sentry\State\Scope $scope): void { + $scope->setUser([ + 'id' => Wcms\Config::url(), + 'username' => Wcms\Config::basepath(), + ]); +}); try { $matchoper = new Wcms\Routes(); $matchoper->match(); } catch (Exception $e) { + Sentry\captureException($e); echo '<h1>⚠ Woops ! There is a little problem : </h1>', $e->getMessage(), "\n"; } |