浏览代码

优化上传异常捕获

Karson 1 年之前
父节点
当前提交
31b307a4a1
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      application/api/controller/Common.php

+ 2 - 0
application/api/controller/Common.php

@@ -137,6 +137,8 @@ class Common extends Api
                 $attachment = $upload->upload();
             } catch (UploadException $e) {
                 $this->error($e->getMessage());
+            } catch (\Exception $e) {
+                $this->error($e->getMessage());
             }
 
             $this->success(__('Uploaded successful'), ['url' => $attachment->url, 'fullurl' => cdnurl($attachment->url, true)]);