Fixed some promises not handling errors
This commit is contained in:
parent
e57de564d9
commit
752af358df
4 changed files with 25 additions and 13 deletions
|
@ -296,6 +296,7 @@ App.Controls.TagInput = function($underlyingInput) {
|
|||
attachTagsToSuggestionList($siblings.find('ul'), suggestions);
|
||||
$siblings.slideDown('fast');
|
||||
}
|
||||
}).fail(function() {
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -51,6 +51,9 @@ App.Presenters.PostListPresenter = function(
|
|||
function() {
|
||||
reinit(params, function() {});
|
||||
});
|
||||
}).fail(function() {
|
||||
console.log(arguments);
|
||||
loaded();
|
||||
});
|
||||
|
||||
jQuery(window).on('resize', windowResized);
|
||||
|
|
|
@ -109,6 +109,7 @@ App.Presenters.PostPresenter = function(
|
|||
$prevPost.removeAttr('href');
|
||||
keyboard.unbind('d');
|
||||
}
|
||||
}).fail(function() {
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,11 @@ App.Services.PostsAroundCalculator = function(_, promise, util, pager) {
|
|||
getLinkToPostAround(postIds, position, query.page, 1))
|
||||
.then(function(nextPostUrl, prevPostUrl) {
|
||||
resolve(nextPostUrl, prevPostUrl);
|
||||
}).fail(function() {
|
||||
reject();
|
||||
});
|
||||
}).fail(function() {
|
||||
reject();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -41,7 +45,8 @@ App.Services.PostsAroundCalculator = function(_, promise, util, pager) {
|
|||
resolve(url);
|
||||
} else if (page + direction >= 1) {
|
||||
pager.setPage(page + direction);
|
||||
promise.wait(pager.retrieveCached()).then(function(response) {
|
||||
promise.wait(pager.retrieveCached())
|
||||
.then(function(response) {
|
||||
if (response.entities.length) {
|
||||
var post = direction === - 1 ?
|
||||
_.last(response.entities) :
|
||||
|
@ -54,6 +59,8 @@ App.Services.PostsAroundCalculator = function(_, promise, util, pager) {
|
|||
} else {
|
||||
resolve(null);
|
||||
}
|
||||
}).fail(function() {
|
||||
reject();
|
||||
});
|
||||
} else {
|
||||
resolve(null);
|
||||
|
|
Loading…
Reference in a new issue