瀏覽代碼

优化上传异常捕获

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();
                 $attachment = $upload->upload();
             } catch (UploadException $e) {
             } catch (UploadException $e) {
                 $this->error($e->getMessage());
                 $this->error($e->getMessage());
+            } catch (\Exception $e) {
+                $this->error($e->getMessage());
             }
             }
 
 
             $this->success(__('Uploaded successful'), ['url' => $attachment->url, 'fullurl' => cdnurl($attachment->url, true)]);
             $this->success(__('Uploaded successful'), ['url' => $attachment->url, 'fullurl' => cdnurl($attachment->url, true)]);