Skip to content

Commit 1c1e740

Browse files
committed
Improve factory error messages
1 parent f890d37 commit 1c1e740

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Loop.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,14 @@ public static function execute(callable $callback, LoopDriver $driver = null)
7474
private static function createDriver()
7575
{
7676
if (self::$factory === null) {
77-
throw new \LogicException("Can't create an event loop driver without a factory.");
77+
throw new \LogicException("No loop driver factory set; Either pass a driver to Loop::execute or set a factory.");
7878
}
7979

8080
$driver = self::$factory->create();
8181

8282
if (!$driver instanceof LoopDriver) {
8383
$type = is_object($driver) ? "an instance of " . get_class($driver) : gettype($driver);
84-
throw new \LogicException("Factory returned {$type}, but must return an instance of LoopDriver.");
84+
throw new \LogicException("Loop driver factory returned {$type}, but must return an instance of LoopDriver.");
8585
}
8686

8787
return $driver;

0 commit comments

Comments
 (0)