[Filesystem] rename() throws RuntimeException on error (fixes #3848).

This commit is contained in:
Alessandro Desantis 2012-04-09 20:56:50 +02:00
parent 127cff0aa8
commit 3f2865b90f

View File

@ -136,7 +136,9 @@ class Filesystem
throw new \RuntimeException(sprintf('Cannot rename because the target "%s" already exist.', $target));
}
rename($origin, $target);
if (false === rename($origin, $target)) {
throw new \RuntimeException(sprintf('Cannot rename "%s" to "%s".', $origin, $target));
}
}
/**