Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Catching can.view load errors

$
0
0
Hi there,

How can I catch load errors for a can.view call? I currently have code like:

  1. can.view(self.options.view, data, function(frag)
  2.               {
  3.                 self.element.html(frag);
  4.                 promise.resolve();
  5.               })
  6.               .fail(function()
  7.               {
  8.                 // this is never called
  9.                 debugger;                
  10.                 promise.reject();
  11.               });
However if I change the requested view path so it will throw an error the fail function never fires, instead I just get the following console output:



Similarly, if I wrap the can.view call in a try/catch, the catch is never called.

Thanks,
Maurice

Viewing all articles
Browse latest Browse all 3491

Trending Articles