feat: 上传文件到 oss 遇到错误时,应该返回错误,避免 panic (#1890)
This commit is contained in:
@@ -92,7 +92,7 @@ func (e *FileUploadAndDownloadService) UploadFile(header *multipart.FileHeader,
|
||||
oss := upload.NewOss()
|
||||
filePath, key, uploadErr := oss.UploadFile(header)
|
||||
if uploadErr != nil {
|
||||
panic(uploadErr)
|
||||
return file, uploadErr
|
||||
}
|
||||
s := strings.Split(header.Filename, ".")
|
||||
f := example.ExaFileUploadAndDownload{
|
||||
|
Reference in New Issue
Block a user