better error handling

This commit is contained in:
2023-10-19 19:20:17 +10:00
parent 8c910ed5f3
commit 114db744b4
3 changed files with 9 additions and 8 deletions

View File

@@ -1020,11 +1020,8 @@ class Media extends Model
$storage = 'private';
}
} else {
try {
if(Storage::disk($storage)->exists('') === false) {
return Media::STORAGE_NOT_FOUND;
}
} catch(\Exception $e) {
$disks = config('filesystems.disks');
if(array_key_exists($storage, $disks) === false) {
return Media::STORAGE_NOT_FOUND;
}