aboutsummaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rw-r--r--index.php30
1 files changed, 19 insertions, 11 deletions
diff --git a/index.php b/index.php
index 1c197f6..13f7bfa 100644
--- a/index.php
+++ b/index.php
@@ -13,24 +13,32 @@ require('./vendor/autoload.php');
$app = new Wcms\Application();
$app->wakeup();
-Sentry\init([
- 'dsn' => Wcms\Config::sentrydsn(),
- 'release' => getversion(),
- 'project_root' => 'app',
-]);
-Sentry\configureScope(function (Sentry\State\Scope $scope): void {
- $scope->setUser([
- 'id' => Wcms\Config::url(),
- 'username' => Wcms\Config::basepath(),
+try {
+ 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(),
+ ]);
+ });
+} catch (Throwable $th) {
+ // No problem: Sentry is optionnal
+}
try {
$matchoper = new Wcms\Routes();
$matchoper->match();
} catch (Exception $e) {
- Sentry\captureException($e);
+ try {
+ Sentry\captureException($e);
+ } catch (Throwable $th) {
+ // No problem: Sentry is optionnal
+ }
echo '<h1>⚠ Woops ! There is a little problem : </h1>', $e->getMessage(), "\n";
}