File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 3
3
namespace Sammyjo20 \Lasso \Helpers ;
4
4
5
5
use Illuminate \Support \Facades \Storage ;
6
+ use League \Flysystem \UnableToWriteFile ;
6
7
use Sammyjo20 \Lasso \Exceptions \ConsoleMethodException ;
7
8
use Sammyjo20 \Lasso \Helpers \Filesystem as LocalFilesystem ;
8
9
@@ -64,7 +65,9 @@ public function uploadFile(string $path, string $name): void
64
65
$ stream = fopen ($ path , 'rb ' );
65
66
66
67
// Use the stream to write the bundle to the Filesystem.
67
- $ this ->cloudFilesystem ->writeStream ($ upload_path , $ stream );
68
+ if ($ this ->cloudFilesystem ->writeStream ($ upload_path , $ stream ) === false ) {
69
+ throw new UnableToWriteFile ("Unable to write file at location " . $ upload_path );
70
+ }
68
71
69
72
// Close the Stream pointer because it's good practice.
70
73
if (is_resource ($ stream )) {
You can’t perform that action at this time.
0 commit comments