mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 08:58:35 +00:00
Handle mkdir errors with exceptions
This commit is contained in:
parent
51df34477c
commit
fdcbb86f43
2 changed files with 4 additions and 2 deletions
|
|
@ -113,7 +113,9 @@ class Resize
|
|||
{
|
||||
// Create directory with write permissions
|
||||
if (null !== $path && !file_exists(dirname($path))) {
|
||||
mkdir(dirname($path), 0777, true);
|
||||
if (!@mkdir(dirname($path), 0755, true)) {
|
||||
throw new Exception('Can\'t create directory '.dirname($path));
|
||||
}
|
||||
}
|
||||
|
||||
switch ($type) {
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ abstract class Device
|
|||
}
|
||||
|
||||
if (!file_exists(dirname($path))) { // Checks if directory path to file exists
|
||||
if (!mkdir(dirname($path), 0755, true)) {
|
||||
if (!@mkdir(dirname($path), 0755, true)) {
|
||||
throw new Exception('Can\'t create directory '.dirname($path));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue