[Filesystem] rename() throws RuntimeException on error (fixes #3848).
This commit is contained in:
parent
127cff0aa8
commit
3f2865b90f
@ -136,7 +136,9 @@ class Filesystem
|
|||||||
throw new \RuntimeException(sprintf('Cannot rename because the target "%s" already exist.', $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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user