Skip to content

Commit c00186d

Browse files
authored
Guard against using feature not available in Lumen (#815)
1 parent 9d469fe commit c00186d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Sentry/Laravel/Tracing/ServiceProvider.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ public function register(): void
6161
$this->app->singleton(Middleware::class, function () {
6262
$continueAfterResponse = ($this->getTracingConfig()['continue_after_response'] ?? true) === true;
6363

64+
// Lumen introduced the `terminating` method in version 9.1.4.
65+
// We check for it's existence and disable the continue after response feature if it's not available.
66+
if (!method_exists($this->app, 'terminating')) {
67+
$continueAfterResponse = false;
68+
}
69+
6470
return new Middleware($this->app, $continueAfterResponse);
6571
});
6672
}

0 commit comments

Comments
 (0)