danialfarid / ng-file-upload

Lightweight Angular directive to upload files with optional FileAPI shim for cross browser support
MIT License
7.87k stars 1.6k forks source link

Fix unhandled promise rejection errors #2115

Closed arcreative closed 5 years ago

arcreative commented 5 years ago

Promises used internally weren't implementing the rejection handler of the .then call, resulting in Unhandled rejection errors in Angular.js. The Angular team chose to arbitrarily include this at one point, but the error is unavoidable on practical HTTP responses like 400 and 422.

@danialfarid It looks like the package handn't been built prior to this change, so there are some changes I didn't make in the dist folder. I'll let you decide if you want it to stay that way or if this needs a revision (or if I should PR off of an earlier commit). The main change is to src/upload.js.

Fixes #2114 Fixes #2085 Fixes #2019 Fixes #1911 Fixes #1853

arcreative commented 5 years ago

My bad, there were some issues in here, digging in further.

drbgfc commented 4 years ago

@arcreative Did you ever come up with a final implementation for this fix? Thanks!

arcreative commented 4 years ago

@drbgfc I didn't, unfortunately. Our team is moving away from angular entirely, so this is not really a priority for us. Wish the fix was simpler!