Aliyun-oss-storage/src/AliOssAdapter.php
为什么在这里获取url,不存在时直接就异常!
/**
* @param $path
*
* @return string
*/
public function getUrl( $path )
{
if (!$this->has($path)) throw new FileNotFoundException($filePath.' not found');
return ( $this->ssl ? 'https://' : 'http://' ) . ( $this->isCname ? ( $this->cdnDomain == '' ? $this->endPoint : $this->cdnDomain ) : $this->bucket . '.' . $this->endPoint ) . '/' . ltrim($path, '/');
}
路径无法找到,仅仅是资源不存在而已,并不是程序无法进行下去,返回空或者null都可以,这里返回异常导致整个程序奔溃。
这里没有结合laravel的环境,调试模式下异常抛出会不会更好,
Aliyun-oss-storage/src/AliOssAdapter.php
为什么在这里获取url,不存在时直接就异常!
/**
* @param $path
*
* @return string
*/
public function getUrl( $path )
{
if (!$this->has($path)) throw new FileNotFoundException($filePath.' not found');
return ( $this->ssl ? 'https://' : 'http://' ) . ( $this->isCname ? ( $this->cdnDomain == '' ? $this->endPoint : $this->cdnDomain ) : $this->bucket . '.' . $this->endPoint ) . '/' . ltrim($path, '/');
}
路径无法找到,仅仅是资源不存在而已,并不是程序无法进行下去,返回空或者null都可以,这里返回异常导致整个程序奔溃。
这里没有结合laravel的环境,调试模式下异常抛出会不会更好,