Permalink
Browse files

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

  • Loading branch information...
1 parent 492c097 commit 4573f17e0143fc365202a3bdf87140f713068466 @alessandro1997 alessandro1997 committed Apr 9, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 Filesystem.php
View
@@ -136,7 +136,9 @@ public function rename($origin, $target)
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));
+ }
}
/**

0 comments on commit 4573f17

Please sign in to comment.