fixed:捕获异常以Json方式返回
This commit is contained in:
parent
65d3111e65
commit
340e8c356b
@ -63,6 +63,7 @@ class CatchUpload
|
|||||||
*/
|
*/
|
||||||
public function upload(UploadedFile $file): string
|
public function upload(UploadedFile $file): string
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
$this->initUploadConfig();
|
$this->initUploadConfig();
|
||||||
|
|
||||||
$path = Filesystem::disk($this->getDriver())->putFile($this->getPath(), $file);
|
$path = Filesystem::disk($this->getDriver())->putFile($this->getPath(), $file);
|
||||||
@ -82,6 +83,10 @@ class CatchUpload
|
|||||||
}
|
}
|
||||||
|
|
||||||
throw new FailedException('Upload Failed, Try Again!');
|
throw new FailedException('Upload Failed, Try Again!');
|
||||||
|
|
||||||
|
} catch (\Exception $exception) {
|
||||||
|
throw new FailedException($exception->getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user