GithubHelp home page GithubHelp logo

Comments (4)

shepherdwind avatar shepherdwind commented on June 3, 2024 1

2.3.3 加了一个 catch

from upload.

shepherdwind avatar shepherdwind commented on June 3, 2024

具体场景列一下,我感觉最好在 Promise 里面直接处理异常吧。不是很清楚为什么一定要在组件里面处理业务异常。

from upload.

xiaodu527 avatar xiaodu527 commented on June 3, 2024

@shepherdwind
我要实现的功能是: 在图片上传之前对file进行压缩处理,并对选择的文件进行筛选
代码如下:
这是 beforeUpload 函数,

qq 20170220202301

我已经用 try catch进行了异常处理,并且在catch里面捕获到了异常,但是上图代码会出现下面的情况:

qq 20170220202121

虽然捕获到了异常,但是 还是上传了这个mp4文件;

只有在catch里面继续抛出异常才能终止这个文件的上传...不知道什么情况?

from upload.

shepherdwind avatar shepherdwind commented on June 3, 2024

哦,我知道了,这里处理是有问题。

from upload.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.