aboutsummaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorn-peugnet <n.peugnet@free.fr>2019-11-07 01:42:54 +0100
committern-peugnet <n.peugnet@free.fr>2019-11-07 01:42:54 +0100
commita1a97e168a5d3c802f12e7351b13dab0a4f68db2 (patch)
treea6fca5cc9a8e3e9ba7bc2e93ce59b00a503302b0 /index.php
parent494da5f44937e55dc1e3180b62e2e6ef98eecc9f (diff)
downloadwcms-a1a97e168a5d3c802f12e7351b13dab0a4f68db2.tar.gz
wcms-a1a97e168a5d3c802f12e7351b13dab0a4f68db2.zip
feat: better sentry conf + send catched errors
Diffstat (limited to 'index.php')
-rw-r--r--index.php13
1 files changed, 12 insertions, 1 deletions
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 '<h1>⚠ Woops ! There is a little problem : </h1>', $e->getMessage(), "\n";
}