You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating an instance of a view and the Ajax call to retrieve the template fails (404, 500, etc), the error callback function is calling the checkText function with an empty string parameter, resulting in a "There is no template or an empty template at..." exception being thrown:
The exception terminates the rendering of the view and the view promise is never rejected. There is no way to determine that the rendering of the view failed and no way to perform custom error handling for the broken view. If the template cannot be found, the view should be rejected, allowing the error to be captured via the .fail callback function on the view promise:
var viewPromise = $.View('badTempatePath', { id: '123' });
$.when(viewPromise)
.done(function(markup) {
//Do something with template markup
})
.fail(function(){
//Handle broken view with custom error markup
});
The text was updated successfully, but these errors were encountered:
When creating an instance of a view and the Ajax call to retrieve the template fails (404, 500, etc), the error callback function is calling the checkText function with an empty string parameter, resulting in a "There is no template or an empty template at..." exception being thrown:
error: function() {
checkText("", url);
callback(404);
}
The exception terminates the rendering of the view and the view promise is never rejected. There is no way to determine that the rendering of the view failed and no way to perform custom error handling for the broken view. If the template cannot be found, the view should be rejected, allowing the error to be captured via the .fail callback function on the view promise:
var viewPromise = $.View('badTempatePath', { id: '123' });
$.when(viewPromise)
.done(function(markup) {
//Do something with template markup
})
.fail(function(){
//Handle broken view with custom error markup
});
The text was updated successfully, but these errors were encountered: