aboutsummaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2019-11-15 19:42:10 +0100
committervincent-peugnet <v.peugnet@free.fr>2019-11-15 19:42:10 +0100
commit7741585fd4658428a8bd9e345604ab297fa281dd (patch)
tree927fb050133f5f5a57b7bd80d724fde8394eade9 /index.php
parentdc041bbd71d1b9d6cfe189f2449a9ee0e9063708 (diff)
parent5c0035fe37cdec5f7927c3213365285a7fd4d51b (diff)
downloadwcms-7741585fd4658428a8bd9e345604ab297fa281dd.tar.gz
wcms-7741585fd4658428a8bd9e345604ab297fa281dd.zip
Merge branch 'integrate-sentry-sdk' of https://github.com/n-peugnet/wcms into n-peugnet-integrate-sentry-sdk
Diffstat (limited to 'index.php')
-rw-r--r--index.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/index.php b/index.php
index 615769d..fd9fdaa 100644
--- a/index.php
+++ b/index.php
@@ -14,11 +14,28 @@ require('./vendor/autoload.php');
$app = new Wcms\Application();
$app->wakeup();
+if (isreportingerrors()) {
+ Sentry\init([
+ 'dsn' => Wcms\Config::sentrydsn(),
+ 'release' => getversion(),
+ 'project_root' => 'app',
+ ]);
+ Sentry\configureScope(function ($scope) {
+ $scope->setUser([
+ 'id' => Wcms\Config::url(),
+ 'username' => Wcms\Config::basepath(),
+ ]);
+ });
+}
+
try {
$matchoper = new Wcms\Routes();
$matchoper->match();
} catch (Exception $e) {
+ if (isreportingerrors()) {
+ Sentry\captureException($e);
+ }
echo '<h1>⚠ Woops ! There is a little problem : </h1>', $e->getMessage(), "\n";
}