There's this weird behavior which I don't know if it is supposed to be happening or it's a winjs bug.
I'm using the WinJS.UI.Pages.render
to render the content of a page under a specific element.
The problem I'm facing is that no matter if I handle the failing of the render
function, the 'error' keeps propagating and it gets "catched" by the onerror
function.
Here's a quick view of my code:
function goFunction() {
WinJS.UI.Pages.render('otherpage.html', root).then(null, failedNavigating);
}
function noGoFunction() {
WinJS.UI.Pages.render('missingpage.html', root).then(null, failedNavigating);
}
function failedNavigating() {
console.log('failed to navigate');
}
WinJS.Application.onerror = function (args) {
debugger;
};
The otherpage.html
page exists so the rendering gets executed and everything is fine. But the missingpage.html
does not exists. In that case the failedNavigating
function executes, so far so good, but then the WinJS.Application.onerror
handler gets 'called'.
Is that how that is supposed to work? What am I missing?
Here's a full project with a repro in case anybody wants to take a look at it.