Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

$q.reject blows up if no errback is supplied #845

Closed
petebacondarwin opened this issue Apr 1, 2012 · 1 comment · Fixed by #846
Closed

$q.reject blows up if no errback is supplied #845

petebacondarwin opened this issue Apr 1, 2012 · 1 comment · Fixed by #846
Assignees

Comments

@petebacondarwin
Copy link
Contributor

I think this may be a bug in $q.reject (see https://github.com/angular/angular.js/blob/master/src/ng/q.js#L277):

If I chain a reject with a then but do not provide an errback callback function the $q.reject method blows up.

See this fiddle: http://jsfiddle.net/dWbWJ/.

I believe that both arguments to the promise.then method can be optional (or at least should be).
I think the $q.reject method should test for the errback before trying to call it.

@ghost ghost assigned IgorMinar Apr 2, 2012
@IgorMinar
Copy link
Contributor

thanks for the report, I'll look into this.

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

Successfully merging a pull request may close this issue.

2 participants