From 1c1e7403924b7f8ceb33115f92549e803863c388 Mon Sep 17 00:00:00 2001 From: Niklas Keller Date: Thu, 19 May 2016 15:51:47 +0200 Subject: [PATCH] Improve factory error messages --- src/Loop.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Loop.php b/src/Loop.php index 222a41c..64e2b7e 100644 --- a/src/Loop.php +++ b/src/Loop.php @@ -74,14 +74,14 @@ final class Loop private static function createDriver() { if (self::$factory === null) { - throw new \LogicException("Can't create an event loop driver without a factory."); + throw new \LogicException("No loop driver factory set; Either pass a driver to Loop::execute or set a factory."); } $driver = self::$factory->create(); if (!$driver instanceof LoopDriver) { $type = is_object($driver) ? "an instance of " . get_class($driver) : gettype($driver); - throw new \LogicException("Factory returned {$type}, but must return an instance of LoopDriver."); + throw new \LogicException("Loop driver factory returned {$type}, but must return an instance of LoopDriver."); } return $driver;