From a1a97e168a5d3c802f12e7351b13dab0a4f68db2 Mon Sep 17 00:00:00 2001 From: n-peugnet Date: Thu, 7 Nov 2019 01:42:54 +0100 Subject: feat: better sentry conf + send catched errors --- index.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index 061509d..20a424c 100644 --- a/index.php +++ b/index.php @@ -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 '

⚠ Woops ! There is a little problem :

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