Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow users to get the status text of the reponse when uploading #863

Closed
wants to merge 1 commit into from

Conversation

vincentrussell
Copy link

I need this to be able to display error messages when the upload fails

@danialfarid
Copy link
Owner

angular $http success and error doesn't return statusText in the parameters and this plugin should follow the same pattern.

@lookfirst
Copy link
Contributor

"On failure, the promise is resolved with the http response object, without the resource property."

$resource does the smart thing and just gives back the entire http response object. I suspect that since $resource probably came after $http, that that is the intended direction of the authors. I'd be curious to find out the thought pattern on that.

In fact, it looks like this has annoyed a lot of other people as well.

Please choose to be on the right side of history on this issue. 😄

@vincentrussell
Copy link
Author

I didn't realize that I could use catch instead of error with ng-file-upload. That actually services my use case just fine.

Thanks,

@danialfarid
Copy link
Owner

You can use then, catch if you need the whole response object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants