MOBILE-2354: Fix missing Promise.reject when using createFakeWSError

main
Albert Gasset 2018-05-30 11:32:54 +02:00
parent eb36ee048c
commit 349df95d7e
5 changed files with 6 additions and 6 deletions

View File

@ -1033,7 +1033,7 @@ export class AddonMessagesProvider {
return this.sendMessagesOnline(messages, siteId).then((response) => {
if (response && response[0] && response[0].msgid === -1) {
// There was an error, and it should be translated already.
return this.utils.createFakeWSError(response[0].errormessage);
return Promise.reject(this.utils.createFakeWSError(response[0].errormessage));
}
return this.invalidateDiscussionCache(toUserId, siteId).catch(() => {

View File

@ -1189,7 +1189,7 @@ export class AddonModFeedbackProvider {
};
return site.write('mod_feedback_process_page', params).catch((error) => {
return this.utils.createFakeWSError(error);
return Promise.reject(this.utils.createFakeWSError(error));
}).then((response) => {
// Invalidate and update current values because they will change.
return this.invalidateCurrentValuesData(feedbackId, site.getId()).then(() => {

View File

@ -179,7 +179,7 @@ export class AddonModForumProvider {
return site.write('mod_forum_add_discussion', params).then((response) => {
// Other errors ocurring.
if (!response || !response.discussionid) {
return this.utils.createFakeWSError('');
return Promise.reject(this.utils.createFakeWSError(''));
} else {
return response.discussionid;
}
@ -694,7 +694,7 @@ export class AddonModForumProvider {
return site.write('mod_forum_add_discussion_post', params).then((response) => {
if (!response || !response.postid) {
return this.utils.createFakeWSError('');
return Promise.reject(this.utils.createFakeWSError(''));
} else {
return response.postid;
}

View File

@ -812,7 +812,7 @@ export class AddonModGlossaryProvider {
return response.entryid;
}
return this.utils.createFakeWSError('');
return Promise.reject(this.utils.createFakeWSError(''));
});
});
}

View File

@ -268,7 +268,7 @@ export class AddonModSurveyProvider {
return site.write('mod_survey_submit_answers', params).then((response) => {
if (!response.status) {
return this.utils.createFakeWSError('');
return Promise.reject(this.utils.createFakeWSError(''));
}
});
});