Skip to content

Commit 91c1584

Browse files
committed
HHVM does not throw warnings on failed unlink - using return values instead
1 parent dd83002 commit 91c1584

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/AssetManager/Cache/FilePathCache.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,14 @@ public function set($key, $value)
9696
*/
9797
public function remove($key)
9898
{
99-
try {
100-
ErrorHandler::start(\E_WARNING);
99+
ErrorHandler::start(\E_WARNING);
101100

102-
$success = unlink($this->cachedFile());
101+
$success = unlink($this->cachedFile());
103102

104-
ErrorHandler::stop(true);
105-
} catch (\ErrorException $e) {
106-
throw new RuntimeException($e->getMessage(), $e->getCode(), $e);
103+
ErrorHandler::stop();
104+
105+
if (false === $success) {
106+
throw new RuntimeException(sprintf('Could not remove key "%s"', $this->cachedFile()));
107107
}
108108

109109
return $success;

0 commit comments

Comments
 (0)