From a05915f953cca944d2d4a88a8cc795a6d7b7ab97 Mon Sep 17 00:00:00 2001 From: Aaron Piotrowski Date: Sat, 13 May 2017 10:21:07 -0500 Subject: [PATCH] Change invalid mode to Error; throw instead of returning Failure --- lib/EioDriver.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/EioDriver.php b/lib/EioDriver.php index 3b639ff..b58fe29 100644 --- a/lib/EioDriver.php +++ b/lib/EioDriver.php @@ -54,11 +54,7 @@ class EioDriver implements Driver { * {@inheritdoc} */ public function open(string $path, string $mode): Promise { - try { - $flags = $this->parseMode($mode); - } catch (\Throwable $exception) { - return new Failure($exception); - } + $flags = $this->parseMode($mode); $chmod = ($flags & \EIO_O_CREAT) ? 0644 : 0; ($this->incrementor)(1); @@ -85,7 +81,7 @@ class EioDriver implements Driver { case 'c+': return \EIO_O_RDWR | \EIO_O_CREAT; default: - throw new FilesystemException('Invalid file mode'); + throw new \Error('Invalid file mode'); } }