AngularJS Nondescript Error at “return logFn.apply(console, args);”

484 views
Skip to first unread message

Gabe Stanek

unread,
Jan 25, 2017, 2:42:29 AM1/25/17
to Angular and AngularJS discussion
Hello All,
I'm seeing a nondescript AngularJS 1.5.x error and am having trouble identifying a solution.  I've created a plunker to show the error.  At that plunker, if you open the developer console on Chrome, you'll see that there is an error thrown at line 13236 of the angular code.  I've also posted this same question on stack overflow with more detail, but haven't seen a response yet.

Any help/pointers would be greatly appreciated.

Thanks,
Gabe


Sander Elias

unread,
Jan 26, 2017, 12:35:03 AM1/26/17
to Angular and AngularJS discussion
Hi Gabe,

I responded on So too. But I now just saw your plunk.
Replace your catch on line 18 with this:

        }).catch(function errorCallback(response) {
            setTimeout
(function() {throw response});
           
//using setTimeout moves the actual throwingout of the
           
// promise chain. It's kind of a hack!
           
return $q.reject(response) //reReject the error, so the rest
           
// of the chain knows there is something wrong
       
});

Again, the promises are just doing what those are supposed to do. This behaviour is exactly what is to be expected, and specced for promises
Hope this clarifies it a bit more for you,

Regards
Sander

Reply all
Reply to author
Forward
0 new messages