We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e4bc85e commit a928073Copy full SHA for a928073
src/EventLoop/Internal/DriverSuspension.php
@@ -77,15 +77,16 @@ public function suspend(): mixed
77
}
78
79
// Awaiting from {main}.
80
- $result = ($this->run)()();
+ $result = ($this->run)();
81
82
/** @psalm-suppress RedundantCondition $this->pending should be changed when resumed. */
83
if ($this->pending) {
84
- // Should only be true if the event loop exited without resolving the promise.
85
- throw new \Error('Scheduler suspended or exited unexpectedly');
+ $result && $result(); // Unwrap any uncaught exceptions from the event loop
+
86
+ throw new \Error('Event loop terminated without resuming the current suspension');
87
88
- return $result;
89
+ return $result();
90
91
92
public function throw(\Throwable $throwable): void
0 commit comments