Skip to content

Commit fd9e996

Browse files
authored
Fixes servers shutting down on concurrent exceptions (#419)
1 parent 65eb090 commit fd9e996

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/Exceptions/TaskExceptionResult.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace Laravel\Octane\Exceptions;
44

5+
use Laravel\SerializableClosure\Support\ClosureStream;
6+
57
class TaskExceptionResult
68
{
79
public function __construct(
@@ -21,7 +23,7 @@ public function __construct(
2123
*/
2224
public static function from($throwable)
2325
{
24-
$fallbackTrace = str_starts_with($throwable->getFile(), 'closure://')
26+
$fallbackTrace = str_starts_with($throwable->getFile(), ClosureStream::STREAM_PROTO.'://')
2527
? collect($throwable->getTrace())->whereNotNull('file')->first()
2628
: null;
2729

src/Stream.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Laravel\Octane;
44

5+
use Laravel\SerializableClosure\Support\ClosureStream;
56
use Throwable;
67

78
class Stream
@@ -35,7 +36,7 @@ public static function request(string $method, string $url, int $statusCode, flo
3536
*/
3637
public static function throwable(Throwable $throwable)
3738
{
38-
$fallbackTrace = str_starts_with($throwable->getFile(), 'closure://')
39+
$fallbackTrace = str_starts_with($throwable->getFile(), ClosureStream::STREAM_PROTO.'://')
3940
? collect($throwable->getTrace())->whereNotNull('file')->first()
4041
: null;
4142

0 commit comments

Comments
 (0)