Better catching failures when Stream::read doesnt returns null
This commit is contained in:
parent
296740aead
commit
b5d2479098
@ -20,6 +20,7 @@ QUEUE_CONNECTION=database
|
|||||||
SESSION_DRIVER=file
|
SESSION_DRIVER=file
|
||||||
SESSION_LIFETIME=120
|
SESSION_LIFETIME=120
|
||||||
|
|
||||||
|
FILESYSTEM_DISK=s3
|
||||||
AWS_ACCESS_KEY_ID=
|
AWS_ACCESS_KEY_ID=
|
||||||
AWS_SECRET_ACCESS_KEY=
|
AWS_SECRET_ACCESS_KEY=
|
||||||
AWS_BUCKET=
|
AWS_BUCKET=
|
||||||
|
@ -86,21 +86,18 @@ final class File extends Send
|
|||||||
$this->size = $this->f->size;
|
$this->size = $this->f->size;
|
||||||
|
|
||||||
// If sending file is a File::class, then our file is s3
|
// If sending file is a File::class, then our file is s3
|
||||||
if ($this->nameas && $this->f instanceof FileModel) {
|
$this->fd = ($this->nameas && $this->f instanceof FileModel)
|
||||||
$this->fd = Storage::readStream($this->f->rel_name);
|
? Storage::readStream($this->f->rel_name)
|
||||||
|
: fopen($this->full_name,'rb');
|
||||||
|
|
||||||
} else {
|
if (! $this->fd) {
|
||||||
$this->fd = fopen($this->full_name,'rb');
|
Log::error(sprintf('%s:! Unable to open file [%s] for reading',self::LOGKEY,$this->full_name));
|
||||||
|
|
||||||
if (! $this->fd) {
|
return FALSE;
|
||||||
Log::error(sprintf('%s:! Unable to open file [%s] for reading',self::LOGKEY,$this->full_name));
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
Log::info(sprintf('%s:= File [%s] opened with size [%d]',self::LOGKEY,$this->full_name,$this->size));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Log::info(sprintf('%s:= File [%s] opened with size [%d]',self::LOGKEY,$this->full_name,$this->size));
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user