I feel like I am going a little crazy, but Angular appears to throw an error for a promise even if I have a catch
defined. It throws the error to the console, then allows the catch
to run.
Here is a super-simple fiddle
The test code:
$q.when(1)
.then(function() {
throw new Error("test");
}).catch(function(error) {
console.log('error caught', error);
});
The resulting console
(dirty liar!)
Here is a fiddle showing what I expect to happen: the catch
is raised, and no other error is logged to the console. Did I fail to configure something, or does Angular implement a broken promise spec?